20 private $converterUtils;
27 $this->converterUtils = $converterUtils;
35 if ($node->nodeType !== XML_ELEMENT_NODE) {
47 private function toArray(\DOMNode $node)
50 'name' => $this->converterUtils->getComponentName($node),
53 if ($this->hasChildNodes($node)) {
55 foreach ($node->childNodes as $childNode) {
56 if ($childNode->nodeType === XML_ELEMENT_NODE) {
57 $childNodeName = $this->converterUtils->getComponentName($childNode);
58 $result[
'item'][$childNodeName] = [
59 'name' => $childNodeName,
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) {
__construct(ConverterUtils $converterUtils)
convert(\DOMNode $node, array $data=[])