Skip to content

Commit e7c61ba

Browse files
authored
tools(deps-dev): Update vimeo/psalm requirement from 5.26.1 to 6.0.0 in /tools/psalm (#499)
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 9660c47 commit e7c61ba

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

src/Core/Validation/BaseValidator.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ protected function getSchemaFile(): string
5151
if (false === \is_string($schemaFile)) {
5252
throw new Exceptions\FailedLoadingSchemaException("Schema file unknown for specVersion: $specVersion->name");
5353
}
54-
if (is_file($schemaFile) && is_readable($schemaFile)) {
55-
return realpath($schemaFile);
54+
$schemaPath = realpath($schemaFile);
55+
if (\is_string($schemaPath) && is_file($schemaPath) && is_readable($schemaPath)) {
56+
return $schemaPath;
5657
}
5758
// @codeCoverageIgnoreStart
5859
throw new Exceptions\FailedLoadingSchemaException("Schema file not readable: $schemaFile");

src/Core/Validation/Errors/JsonValidationError.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ class JsonValidationError extends ValidationError
3737
public static function fromSchemaValidationError(JsonSchema\Errors\ValidationError $error): static
3838
{
3939
$formatter = new JsonSchema\Errors\ErrorFormatter();
40-
$instance = new static(
41-
json_encode(
42-
$formatter->format($error, true),
43-
\JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES
44-
)
40+
$message = json_encode(
41+
$formatter->format($error, true),
42+
\JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES
4543
);
44+
\assert(\is_string($message));
45+
$instance = new static($message);
4646
$instance->error = $error;
4747

4848
return $instance;

src/Core/Validation/Validators/XmlValidator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ private function validateDomWithSchema(DOMDocument $doc): ?LibXMLError
8888
libxml_clear_errors();
8989

9090
$valid = $doc->schemaValidate($schema);
91-
$error = $valid ? null : libxml_get_last_error();
91+
$error = $valid ? null : (libxml_get_last_error() ?: null);
9292

9393
libxml_clear_errors();
9494
libxml_use_internal_errors($prevXmlUIE);

tools/psalm/composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
},
88
"require-dev": {
99
"roave/security-advisories": "dev-latest",
10-
"vimeo/psalm": "5.26.1"
10+
"vimeo/psalm": "^6.0.0"
1111
},
1212
"prefer-stable": true,
1313
"config": {

0 commit comments

Comments
 (0)