Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 6 |
|
0.00% |
0 / 6 |
CRAP | |
0.00% |
0 / 1 |
IteratorDecorator | |
0.00% |
0 / 6 |
|
0.00% |
0 / 6 |
42 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
current | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
key | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
next | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
rewind | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
valid | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace CirrusSearch\Iterator; |
4 | |
5 | use Iterator; |
6 | |
7 | /** |
8 | * Allows extending classes to decorate an Iterator with |
9 | * reduced boilerplate. |
10 | */ |
11 | abstract class IteratorDecorator implements Iterator { |
12 | protected Iterator $iterator; |
13 | |
14 | public function __construct( Iterator $iterator ) { |
15 | $this->iterator = $iterator; |
16 | } |
17 | |
18 | #[\ReturnTypeWillChange] |
19 | public function current() { |
20 | return $this->iterator->current(); |
21 | } |
22 | |
23 | #[\ReturnTypeWillChange] |
24 | public function key() { |
25 | return $this->iterator->key(); |
26 | } |
27 | |
28 | public function next(): void { |
29 | $this->iterator->next(); |
30 | } |
31 | |
32 | public function rewind(): void { |
33 | $this->iterator->rewind(); |
34 | } |
35 | |
36 | public function valid(): bool { |
37 | return $this->iterator->valid(); |
38 | } |
39 | } |