Total Complexity | 6 |
Total Lines | 34 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
21 | final class NodeIterator implements \IteratorAggregate |
||
22 | { |
||
23 | public const FLAG_BLOCKS_ONLY = 1; |
||
24 | |||
25 | private Node $node; |
||
26 | private bool $blocksOnly; |
||
27 | |||
28 | 548 | public function __construct(Node $node, int $flags = 0) |
|
32 | } |
||
33 | |||
34 | /** |
||
35 | * @return \Generator<int, Node> |
||
36 | */ |
||
37 | 548 | public function getIterator(): \Generator |
|
59 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.