Skip to content

Commit cee475a

Browse files
committed
s/self/static
1 parent faa3768 commit cee475a

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/XML/ExtendableAttributesTrait.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ protected static function getAttributesNSFromXML(
109109
foreach ($xml->attributes as $a) {
110110
if (in_array([$a->namespaceURI, $a->localName], $exclusionList, true)) {
111111
continue;
112-
} elseif ($namespace === NS::OTHER && in_array($a->namespaceURI, [self::NS, null], true)) {
112+
} elseif ($namespace === NS::OTHER && in_array($a->namespaceURI, [static::NS, null], true)) {
113113
continue;
114-
} elseif ($namespace === NS::TARGETNAMESPACE && $a->namespaceURI !== self::NS) {
114+
} elseif ($namespace === NS::TARGETNAMESPACE && $a->namespaceURI !== static::NS) {
115115
continue;
116116
} elseif ($namespace === NS::LOCAL && $a->namespaceURI !== null) {
117117
continue;
@@ -133,7 +133,7 @@ protected static function getAttributesNSFromXML(
133133

134134
// Replace the ##targetedNamespace with the actual namespace
135135
if (($key = array_search(NS::TARGETNAMESPACE, $namespace)) !== false) {
136-
$namespace[$key] = self::NS;
136+
$namespace[$key] = static::NS;
137137
}
138138

139139
// Replace the ##local with null
@@ -207,7 +207,7 @@ function (Attribute $attr) {
207207

208208
// Replace the ##targetedNamespace with the actual namespace
209209
if (($key = array_search(NS::TARGETNAMESPACE, $allowed_namespaces)) !== false) {
210-
$allowed_namespaces[$key] = self::NS;
210+
$allowed_namespaces[$key] = static::NS;
211211
}
212212

213213
// Replace the ##local with null
@@ -221,7 +221,7 @@ function (Attribute $attr) {
221221
sprintf(
222222
'Attributes from namespaces [ %s ] are not allowed inside a %s element.',
223223
rtrim(implode(', ', $diff)),
224-
self::NS,
224+
static::NS,
225225
),
226226
);
227227
} else {
@@ -230,10 +230,10 @@ function (Attribute $attr) {
230230
Assert::allNotNull($actual_namespaces);
231231

232232
// Must be any namespace other than the parent element
233-
Assert::allNotSame($actual_namespaces, self::NS);
233+
Assert::allNotSame($actual_namespaces, static::NS);
234234
} elseif ($namespace === NS::TARGETNAMESPACE) {
235235
// Must be the same namespace as the one of the parent element
236-
Assert::allSame($actual_namespaces, self::NS);
236+
Assert::allSame($actual_namespaces, static::NS);
237237
}
238238
}
239239

src/XML/ExtendableElementTrait.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ protected static function getChildElementsFromXML(
6060
continue;
6161
} elseif (in_array([$elt->namespaceURI, $elt->localName], $exclusionList, true)) {
6262
continue;
63-
} elseif ($namespace === NS::OTHER && in_array($elt->namespaceURI, [self::NS, null], true)) {
63+
} elseif ($namespace === NS::OTHER && in_array($elt->namespaceURI, [static::NS, null], true)) {
6464
continue;
65-
} elseif ($namespace === NS::TARGETNAMESPACE && $elt->namespaceURI !== self::NS) {
65+
} elseif ($namespace === NS::TARGETNAMESPACE && $elt->namespaceURI !== static::NS) {
6666
continue;
6767
} elseif ($namespace === NS::LOCAL && $elt->namespaceURI !== null) {
6868
continue;
@@ -80,7 +80,7 @@ protected static function getChildElementsFromXML(
8080

8181
// Replace the ##targetedNamespace with the actual namespace
8282
if (($key = array_search(NS::TARGETNAMESPACE, $namespace)) !== false) {
83-
$namespace[$key] = self::NS;
83+
$namespace[$key] = static::NS;
8484
}
8585

8686
// Replace the ##local with null
@@ -150,7 +150,7 @@ function (AbstractElement|Chunk $elt): ?string {
150150

151151
// Replace the ##targetedNamespace with the actual namespace
152152
if (($key = array_search(NS::TARGETNAMESPACE, $allowed_namespaces)) !== false) {
153-
$allowed_namespaces[$key] = self::NS;
153+
$allowed_namespaces[$key] = static::NS;
154154
}
155155

156156
// Replace the ##local with null
@@ -164,16 +164,16 @@ function (AbstractElement|Chunk $elt): ?string {
164164
sprintf(
165165
'Elements from namespaces [ %s ] are not allowed inside a %s element.',
166166
rtrim(implode(', ', $diff)),
167-
self::NS,
167+
static::NS,
168168
),
169169
);
170170
} elseif ($namespace === NS::OTHER) {
171171
// Must be any namespace other than the parent element, excluding elements with no namespace
172172
Assert::notInArray(null, $actual_namespaces);
173-
Assert::allNotSame($actual_namespaces, self::NS);
173+
Assert::allNotSame($actual_namespaces, static::NS);
174174
} elseif ($namespace === NS::TARGETNAMESPACE) {
175175
// Must be the same namespace as the one of the parent element
176-
Assert::allSame($actual_namespaces, self::NS);
176+
Assert::allSame($actual_namespaces, static::NS);
177177
} else {
178178
// XS_ANY_NS_ANY
179179
}

0 commit comments

Comments
 (0)