21 private $converterUtils;
28 $this->converterUtils = $converterUtils;
36 if ($node->nodeType !== XML_ELEMENT_NODE) {
48 private function toArray(\DOMNode $node)
51 'name' => $this->converterUtils->getComponentName($node),
54 if ($this->hasChildNodes($node)) {
56 foreach ($node->childNodes as $childNode) {
57 if ($childNode->nodeType === XML_ELEMENT_NODE) {
58 $result[
'item'][$this->converterUtils->getComponentName($childNode)] = [
59 'name' => $childNode->getAttribute(
'name'),
61 'value' => trim($childNode->nodeValue)
75 private function hasChildNodes(\DOMNode $node)
77 if (!$node->hasChildNodes()) {
81 foreach ($node->childNodes as $child) {
82 if ($child->nodeType == XML_ELEMENT_NODE) {
convert(\DOMNode $node, array $data=[])
__construct(ConverterUtils $converterUtils)