File tree Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Expand file tree Collapse file tree 4 files changed +10
-9
lines changed Original file line number Diff line number Diff 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 " );
Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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 );
Original file line number Diff line number Diff line change 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" : {
You can’t perform that action at this time.
0 commit comments