| Conditions | 4 |
| Paths | 5 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | private static function sxiToArray(SimpleXMLIterator $sxi): array |
||
| 30 | { |
||
| 31 | $a = []; |
||
| 32 | for ($sxi->rewind(); $sxi->valid(); $sxi->next()) { |
||
| 33 | if (!array_key_exists($sxi->key(), $a)) { |
||
| 34 | $a[$sxi->key()] = []; |
||
| 35 | } |
||
| 36 | |||
| 37 | if ($sxi->hasChildren()) { |
||
| 38 | $a[$sxi->key()][] = self::sxiToArray($sxi->current()); |
||
| 39 | } else { |
||
| 40 | $a[$sxi->key()][] = strval($sxi->current()); |
||
| 41 | } |
||
| 42 | } |
||
| 43 | return $a; |
||
| 44 | } |
||
| 45 | } |