Total Complexity | 6 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | trait IteratorTrait |
||
6 | { |
||
7 | private int $offset = 0; |
||
|
|||
8 | /** |
||
9 | * {@inheritdoc} |
||
10 | */ |
||
11 | 20 | public function current() |
|
14 | } |
||
15 | |||
16 | 2 | public function key(): int |
|
17 | { |
||
18 | 2 | return $this->offset; |
|
19 | } |
||
20 | |||
21 | /** |
||
22 | * {@inheritdoc} |
||
23 | */ |
||
24 | 18 | public function next(): void |
|
25 | { |
||
26 | 18 | ++$this->offset; |
|
27 | 18 | } |
|
28 | |||
29 | 20 | public function valid(): bool |
|
30 | { |
||
31 | 20 | return isset($this->array[$this->offset]); |
|
32 | } |
||
33 | |||
34 | 19 | public function rewind(): void |
|
37 | 19 | } |
|
38 | } |
||
39 |