| Conditions | 3 |
| Paths | 1 |
| Total Lines | 17 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3 |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | 11 | public static function getDomElements(\DOMNodeList $nodeList, ?string $nodeName): array |
|
| 8 | { |
||
| 9 | 11 | $els = array_filter(iterator_to_array($nodeList), function ($node) use ($nodeName) { |
|
| 10 | // return $node instanceof \DOMElement && ($nodeName && $node->nodeName === $nodeName); |
||
| 11 | |||
| 12 | 11 | if (! $node instanceof \DOMElement) { |
|
| 13 | 10 | return false; |
|
| 14 | } |
||
| 15 | |||
| 16 | 11 | if (! $nodeName) { |
|
| 17 | 4 | return true; |
|
| 18 | } |
||
| 19 | |||
| 20 | 7 | return $node->nodeName === $nodeName; |
|
| 21 | }); |
||
| 22 | |||
| 23 | 11 | return array_values($els); |
|
| 24 | } |
||
| 48 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths