@@ -174,16 +174,16 @@ private function createNode(string $name, mixed $text, array $attributes, array
174
174
{
175
175
$ usedNamespaces = $ this ->getUsedNamespaces ($ name , $ attributes );
176
176
177
- $ namespaces = array_merge ($ namespaces , ...array_map (static fn (ReadResult $ element ) => $ element ->namespaces , $ elements ));
178
- $ usedNamespaces = array_merge ($ usedNamespaces , ...array_map (static fn (ReadResult $ element ) => $ element ->usedNamespaces , $ elements ));
177
+ $ namespaces = array_merge ($ namespaces , ...array_map (static fn (ReadResult $ element ) => $ element ->namespaces , $ elements ));
178
+ $ usedNamespaces = array_merge ($ usedNamespaces , ...array_map (static fn (ReadResult $ element ) => $ element ->usedNamespaces , $ elements ));
179
179
180
180
$ withNamespace = $ rootNamespaces !== null ;
181
181
182
182
if ($ withNamespace ) {
183
183
$ namespaceAttributes = $ this ->namespacesToAttributes ($ namespaces , $ rootNamespaces );
184
184
$ namespaceAttributes = array_filter (
185
185
$ namespaceAttributes ,
186
- static fn ($ namespaceLocalName ) => in_array (Parser::getLocalName ($ namespaceLocalName ), $ usedNamespaces ),
186
+ static fn ($ namespaceLocalName ) => in_array (Parser::getLocalName ($ namespaceLocalName ), $ usedNamespaces ),
187
187
ARRAY_FILTER_USE_KEY ,
188
188
);
189
189
@@ -208,8 +208,8 @@ private function getUsedNamespaces(string $name, array $attributes): array
208
208
{
209
209
return array_values (array_filter ([
210
210
Parser::getNamespacePrefix ($ name ),
211
- ...array_map (static fn ($ attributeName ) => Parser::getNamespacePrefix ($ attributeName ), array_keys ($ attributes )),
212
- ], static fn ($ ns ) => $ ns !== null && $ ns !== 'xmlns ' ));
211
+ ...array_map (static fn ($ attributeName ) => Parser::getNamespacePrefix ($ attributeName ), array_keys ($ attributes )),
212
+ ], static fn ($ ns ) => $ ns !== null && $ ns !== 'xmlns ' ));
213
213
}
214
214
215
215
/**
@@ -231,7 +231,7 @@ private function namespacesToAttributes(array $namespaces, array $rootNamespaces
231
231
*/
232
232
private function read (): bool
233
233
{
234
- return Handler::withErrorHandlerForXMLReader (fn (): bool => $ this ->reader ->read ());
234
+ return Handler::withErrorHandlerForXMLReader (fn (): bool => $ this ->reader ->read ());
235
235
}
236
236
237
237
private function next (?string $ name = null ): bool
0 commit comments