Conditions | 3 |
Paths | 4 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
19 | 7 | public function export(NodeInterface $node): string |
|
20 | { |
||
21 | 7 | $children = []; |
|
22 | |||
23 | /** @var NodeInterface $child */ |
||
24 | 7 | foreach ($node->children() as $child) { |
|
25 | 6 | $children[] = $this->export($child); |
|
26 | } |
||
27 | |||
28 | 7 | return [] === $children ? |
|
29 | 7 | sprintf('[%s]', $node->label()) : |
|
30 | 7 | sprintf('[%s%s]', $node->label(), implode('', $children)); |
|
31 | } |
||
33 |