@@ 147-154 (lines=8) @@ | ||
144 | * @param \DOMElement $node |
|
145 | * @return string |
|
146 | */ |
|
147 | private function getType(\DOMElement $node): string { |
|
148 | if ($node->hasAttributeNS(self::XMLNS_JSONDOM, 'type')) { |
|
149 | return $node->getAttributeNS(self::XMLNS_JSONDOM, 'type'); |
|
150 | } else { |
|
151 | $xpath = new Xpath($node->ownerDocument); |
|
152 | return $xpath('count(*) > 0', $node) ? 'object' : 'string'; |
|
153 | } |
|
154 | } |
|
155 | ||
156 | /** |
|
157 | * @param \DOMElement $node |
@@ 115-122 (lines=8) @@ | ||
112 | * @param \DOMElement $node |
|
113 | * @return string |
|
114 | */ |
|
115 | private function getType(\DOMElement $node): string { |
|
116 | if ($node->hasAttributeNS(self::XMLNS_JSONDOM, 'type')) { |
|
117 | return $node->getAttributeNS(self::XMLNS_JSONDOM, 'type'); |
|
118 | } else { |
|
119 | $xpath = new Xpath($node->ownerDocument); |
|
120 | return $xpath('count(*) > 0', $node) ? 'object' : 'string'; |
|
121 | } |
|
122 | } |
|
123 | } |
|
124 | } |