Skip to content

Commit

Permalink
Fix bugs
Browse files Browse the repository at this point in the history
- Remove comments
- Fix bugs when collect namespaces
  • Loading branch information
JackieDo committed Nov 28, 2018
1 parent f0a0c22 commit e1396f1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Xml2Array.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ protected function parseChildNodes(DOMNode $node, $output)
$output = $value;
}
}
} else {
} elseif ($child->nodeType !== XML_COMMENT_NODE) {
$nodeName = $child->nodeName;

if (!isset($output[$nodeName])) {
Expand Down Expand Up @@ -367,7 +367,9 @@ protected function collectAttributes(DOMNode $node, $output)
}
}

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

return $output;
}
Expand Down

0 comments on commit e1396f1

Please sign in to comment.