| Conditions | 5 |
| Paths | 6 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 52 | protected function simpleXmlToArray(SimpleXMLElement $xmlElement): array |
||
| 53 | { |
||
| 54 | $result = []; |
||
| 55 | |||
| 56 | $attributes = $xmlElement->attributes(); |
||
| 57 | if ($xmlElement->count() > 0 && $attributes->count() > 0) { |
||
| 58 | $result['@attributes'] = ((array)$attributes)['@attributes']; |
||
| 59 | } |
||
| 60 | |||
| 61 | foreach ($xmlElement->children() as $node) { |
||
| 62 | /** @var \SimpleXMLElement $node */ |
||
| 63 | $result[$node->getName()] = $node->count() > 0 ? $this->simpleXmlToArray($node) : (string)$node; |
||
| 64 | } |
||
| 65 | |||
| 66 | return $result; |
||
| 67 | } |
||
| 69 |