@@ -174,16 +174,16 @@ private function createNode(string $name, mixed $text, array $attributes, array
174174 {
175175 $ usedNamespaces = $ this ->getUsedNamespaces ($ name , $ attributes );
176176
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 ));
179179
180180 $ withNamespace = $ rootNamespaces !== null ;
181181
182182 if ($ withNamespace ) {
183183 $ namespaceAttributes = $ this ->namespacesToAttributes ($ namespaces , $ rootNamespaces );
184184 $ namespaceAttributes = array_filter (
185185 $ namespaceAttributes ,
186- static fn ($ namespaceLocalName ) => in_array (Parser::getLocalName ($ namespaceLocalName ), $ usedNamespaces ),
186+ static fn ($ namespaceLocalName ) => in_array (Parser::getLocalName ($ namespaceLocalName ), $ usedNamespaces ),
187187 ARRAY_FILTER_USE_KEY ,
188188 );
189189
@@ -208,8 +208,8 @@ private function getUsedNamespaces(string $name, array $attributes): array
208208 {
209209 return array_values (array_filter ([
210210 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 ' ));
213213 }
214214
215215 /**
@@ -231,7 +231,7 @@ private function namespacesToAttributes(array $namespaces, array $rootNamespaces
231231 */
232232 private function read (): bool
233233 {
234- return Handler::withErrorHandlerForXMLReader (fn (): bool => $ this ->reader ->read ());
234+ return Handler::withErrorHandlerForXMLReader (fn (): bool => $ this ->reader ->read ());
235235 }
236236
237237 private function next (?string $ name = null ): bool
0 commit comments