Skip to content

Commit e1396f1

Browse files
committed
Fix bugs
- Remove comments - Fix bugs when collect namespaces
1 parent f0a0c22 commit e1396f1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Xml2Array.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ protected function parseChildNodes(DOMNode $node, $output)
268268
$output = $value;
269269
}
270270
}
271-
} else {
271+
} elseif ($child->nodeType !== XML_COMMENT_NODE) {
272272
$nodeName = $child->nodeName;
273273

274274
if (!isset($output[$nodeName])) {
@@ -367,7 +367,9 @@ protected function collectAttributes(DOMNode $node, $output)
367367
}
368368
}
369369

370-
$output[$this->config['attributesKey']] = array_merge($attributes, $namespaces);
370+
foreach (array_merge($attributes, $namespaces) as $key => $value) {
371+
$output[$this->config['attributesKey']][$key] = $value;
372+
}
371373

372374
return $output;
373375
}

0 commit comments

Comments
 (0)