Skip to content

Commit

Permalink
Merge pull request #39 from LibreSign/bugfix/check-if-key-exists
Browse files Browse the repository at this point in the history
Check if key exists
  • Loading branch information
vitormattos authored Jun 8, 2023
2 parents 83f9fbe + 324ef77 commit 844f912
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 33 deletions.
9 changes: 8 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,14 @@
"config": {
"allow-plugins": {
"bamarni/composer-bin-plugin": true
}
},
"optimize-autoloader": true
},
"extra": {
"bamarni-bin": {
"bin-links": true,
"forward-command": true
}
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 2 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?xml version="1.0"?>
<psalm
errorLevel="2"
findUnusedBaselineEntry="true"
findUnusedCode="false"
resolveFromConfigFile="true"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="https://getpsalm.org/schema/config"
Expand Down
5 changes: 5 additions & 0 deletions src/NextcloudApiContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ public function theResponseShouldBeAJsonArrayWithTheFollowingMandatoryValues(Tab
$expectedValues = $table->getColumnsHash();
$realResponseArray = json_decode($this->response->getBody()->getContents(), true);
foreach ($expectedValues as $value) {
Assert::assertArrayHasKey(
$value['key'],
$realResponseArray,
'Not found: "' . $value['key'] . '" at array: ' . json_encode($realResponseArray)
);
if (is_bool($realResponseArray[$value['key']])
|| is_iterable($realResponseArray[$value['key']])
|| is_numeric($realResponseArray[$value['key']])
Expand Down
2 changes: 1 addition & 1 deletion vendor-bin/coding-standard/composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"require-dev": {
"nextcloud/coding-standard": "^1.1"
"nextcloud/coding-standard": "1.1.0"
}
}
24 changes: 14 additions & 10 deletions vendor-bin/coding-standard/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 26 additions & 21 deletions vendor-bin/psalm/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 844f912

Please sign in to comment.