File tree 2 files changed +7
-7
lines changed
2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ trait EvaluationContextTrait
22
22
23
23
public function pushSchema (
24
24
\stdClass |bool |null $ schema = null ,
25
- string $ keywordLocationFragment = null ,
25
+ ? string $ keywordLocationFragment = null ,
26
26
?string $ baseUri = null ,
27
27
string $ schemaLocation = ''
28
28
): void {
@@ -36,7 +36,7 @@ public function pushSchema(
36
36
$ schemaKeywordLocation = $ schemaLocation ;
37
37
}
38
38
39
- if ($ keywordLocationFragment ) {
39
+ if (is_string ( $ keywordLocationFragment) && strlen ( $ keywordLocationFragment ) ) {
40
40
$ schemaKeywordLocation .= '/ ' . $ keywordLocationFragment ;
41
41
$ keywordLocation = $ currentStackEntry ['keywordLocation ' ] . '/ ' . $ keywordLocationFragment ;
42
42
} else {
@@ -126,7 +126,7 @@ public function getCurrentAbsoluteKeywordLocation(): ?string
126
126
$ currentStackEntry = $ this ->schemaStack [$ this ->schemaStackPointer ];
127
127
128
128
$ baseUri = $ currentStackEntry ['baseUri ' ];
129
- if (!$ baseUri ) {
129
+ if (!is_string ( $ baseUri) || ! strlen ( $ baseUri ) ) {
130
130
return null ;
131
131
}
132
132
Original file line number Diff line number Diff line change @@ -44,12 +44,12 @@ public function __construct(
44
44
$ this ->draft = $ staticEvaluationContext ->config ->defaultDraft ;
45
45
}
46
46
47
- public function pushInstance (mixed &$ instance , string $ instanceLocationFragment = null ): void
47
+ public function pushInstance (mixed &$ instance , ? string $ instanceLocationFragment = null ): void
48
48
{
49
- if ($ instanceLocationFragment === null ) {
50
- $ instanceLocation = $ this ->getCurrentInstanceLocation ();
51
- } else {
49
+ if (is_string ($ instanceLocationFragment ) && strlen ($ instanceLocationFragment )) {
52
50
$ instanceLocation = $ this ->getCurrentInstanceLocation () . '/ ' . $ instanceLocationFragment ;
51
+ } else {
52
+ $ instanceLocation = $ this ->getCurrentInstanceLocation ();
53
53
}
54
54
55
55
$ this ->instanceStack [++$ this ->instanceStackPointer ] = [
You can’t perform that action at this time.
0 commit comments