Skip to content

Commit

Permalink
tools(deps-dev): Update vimeo/psalm requirement from 5.26.1 to 6.0.0 …
Browse files Browse the repository at this point in the history
…in /tools/psalm (#499)

Signed-off-by: Jan Kowalleck <[email protected]>
  • Loading branch information
jkowalleck authored Jan 27, 2025
1 parent 9660c47 commit e7c61ba
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/Core/Validation/BaseValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ protected function getSchemaFile(): string
if (false === \is_string($schemaFile)) {
throw new Exceptions\FailedLoadingSchemaException("Schema file unknown for specVersion: $specVersion->name");
}
if (is_file($schemaFile) && is_readable($schemaFile)) {
return realpath($schemaFile);
$schemaPath = realpath($schemaFile);
if (\is_string($schemaPath) && is_file($schemaPath) && is_readable($schemaPath)) {
return $schemaPath;
}
// @codeCoverageIgnoreStart
throw new Exceptions\FailedLoadingSchemaException("Schema file not readable: $schemaFile");
Expand Down
10 changes: 5 additions & 5 deletions src/Core/Validation/Errors/JsonValidationError.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ class JsonValidationError extends ValidationError
public static function fromSchemaValidationError(JsonSchema\Errors\ValidationError $error): static
{
$formatter = new JsonSchema\Errors\ErrorFormatter();
$instance = new static(
json_encode(
$formatter->format($error, true),
\JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES
)
$message = json_encode(
$formatter->format($error, true),
\JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES
);
\assert(\is_string($message));
$instance = new static($message);
$instance->error = $error;

return $instance;
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Validation/Validators/XmlValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ private function validateDomWithSchema(DOMDocument $doc): ?LibXMLError
libxml_clear_errors();

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

libxml_clear_errors();
libxml_use_internal_errors($prevXmlUIE);
Expand Down
2 changes: 1 addition & 1 deletion tools/psalm/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"require-dev": {
"roave/security-advisories": "dev-latest",
"vimeo/psalm": "5.26.1"
"vimeo/psalm": "^6.0.0"
},
"prefer-stable": true,
"config": {
Expand Down

0 comments on commit e7c61ba

Please sign in to comment.