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