| Conditions | 3 |
| Paths | 2 |
| Total Lines | 22 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 3 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 38 | 1 | private function getAllNodeChildren(Node $astNode): array |
|
| 39 | { |
||
| 40 | /** @var array<int, array<int, Node>> $astNodes */ |
||
| 41 | 1 | $astNodes = array_map( |
|
| 42 | static function (string $subNodeName) use ($astNode): array { |
||
| 43 | 1 | $subNodes = $astNode->{$subNodeName}; |
|
| 44 | |||
| 45 | 1 | if (!is_array($subNodes)) { |
|
| 46 | 1 | $subNodes = [$subNodes]; |
|
| 47 | } |
||
| 48 | |||
| 49 | 1 | return array_filter( |
|
| 50 | 1 | $subNodes, |
|
| 51 | 1 | 'is_object' |
|
| 52 | ); |
||
| 53 | 1 | }, |
|
| 54 | 1 | $astNode->getSubNodeNames() |
|
| 55 | ); |
||
| 56 | |||
| 57 | 1 | return [] === $astNodes ? |
|
| 58 | 1 | [] : |
|
| 59 | 1 | array_merge(...$astNodes); |
|
| 60 | } |
||
| 85 |