Total Complexity | 8 |
Total Lines | 67 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
16 | class SequenceIterator implements SequenceIteratorInterface |
||
17 | { |
||
18 | /** |
||
19 | * @var SequenceInterface<T> sequence for iterating |
||
20 | */ |
||
21 | protected SequenceInterface $sequence; |
||
22 | /** |
||
23 | * @var int current iteration index |
||
24 | */ |
||
25 | protected int $currentIndex; |
||
26 | /** |
||
27 | * @var T current iteration value |
||
|
|||
28 | */ |
||
29 | protected $currentValue; |
||
30 | |||
31 | /** |
||
32 | * SequenceIterator constructor. |
||
33 | * |
||
34 | * @param SequenceInterface<T> $sequence |
||
35 | */ |
||
36 | 70 | public function __construct(SequenceInterface $sequence) |
|
37 | { |
||
38 | 70 | $this->sequence = $sequence; |
|
39 | 70 | $this->currentIndex = 0; |
|
40 | } |
||
41 | |||
42 | /** |
||
43 | * {@inheritDoc} |
||
44 | */ |
||
45 | 59 | public function current() |
|
46 | { |
||
47 | 59 | return $this->currentValue; |
|
48 | } |
||
49 | |||
50 | /** |
||
51 | * {@inheritDoc} |
||
52 | */ |
||
53 | 59 | public function next(): void |
|
54 | { |
||
55 | 59 | $this->currentIndex++; |
|
56 | 59 | $this->currentValue = $this->sequence->getNextValue($this->currentValue); |
|
57 | } |
||
58 | |||
59 | /** |
||
60 | * {@inheritDoc} |
||
61 | */ |
||
62 | 41 | public function key(): int |
|
63 | { |
||
64 | 41 | return $this->currentIndex; |
|
65 | } |
||
66 | |||
67 | /** |
||
68 | * {@inheritDoc} |
||
69 | */ |
||
70 | 70 | public function valid(): bool |
|
71 | { |
||
72 | 70 | $count = $this->sequence->isInfinite() ? INF : $this->sequence->count(); |
|
73 | 70 | return $this->currentIndex >= 0 && $this->currentIndex < $count; |
|
74 | } |
||
75 | |||
76 | /** |
||
77 | * {@inheritDoc} |
||
78 | */ |
||
79 | 70 | public function rewind(): void |
|
83 | } |
||
84 | } |
||
85 |
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