Skip to content

Commit 41f82e6

Browse files
committed
Suppress psalm issue
1 parent 22aa1db commit 41f82e6

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/validateJSONSchema.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,20 @@
5252
echo '['.str_pad(strval($index+1), $countChars, ' ', STR_PAD_LEFT).'/'.count($files).'] '.
5353
$formattedFilename;
5454
try {
55-
/** @var scalar|object $json */
56-
$json = json_decode(file_get_contents($file), false, flags: JSON_THROW_ON_ERROR);
55+
/**
56+
* @var scalar|object $json
57+
*/
58+
$json = json_decode(file_get_contents($file), flags: JSON_THROW_ON_ERROR);
5759
} catch(JsonException $ex){
5860
echo "[\033[31mSYNTAX ERROR\033[0m]".PHP_EOL;
5961
$errors++;
6062
continue;
6163
}
6264

6365
try {
66+
/**
67+
* @psalm-suppress PossiblyInvalidPropertyFetch
68+
*/
6469
$result = $validator->validate($json, $json->{'$schema'} ?? 'https://json-schema.org/draft/2020-12/schema');
6570
if(!$result->isValid()){
6671
$errorMessage = json_encode(((new ErrorFormatter())->format($result->error())),

0 commit comments

Comments
 (0)