Conditions | 5 |
Paths | 6 |
Total Lines | 8 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
14 | private function collectRecursiveChildren(?\DOMNode $node, array $nodes = []): array |
||
15 | { |
||
16 | if ($node instanceof \DOMElement && $node->hasChildNodes()) { |
||
17 | ['parent' => $parent, 'children' => $children] = $this->collectRecursions($node); |
||
18 | $nodes[] = $children ? [$parent, $children] : $parent; |
||
19 | } |
||
20 | |||
21 | return null !== $node->nextSibling ? $this->collectRecursiveChildren($node->nextSibling, $nodes) : $nodes; |
||
22 | } |
||
46 |