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 | /** @return mixed */ |
| 19 | #[\ReturnTypeWillChange] |
| 20 | public function current() { |
| 21 | return $this->iterator->current(); |
| 22 | } |
| 23 | |
| 24 | /** @return mixed */ |
| 25 | #[\ReturnTypeWillChange] |
| 26 | public function key() { |
| 27 | return $this->iterator->key(); |
| 28 | } |
| 29 | |
| 30 | public function next(): void { |
| 31 | $this->iterator->next(); |
| 32 | } |
| 33 | |
| 34 | public function rewind(): void { |
| 35 | $this->iterator->rewind(); |
| 36 | } |
| 37 | |
| 38 | public function valid(): bool { |
| 39 | return $this->iterator->valid(); |
| 40 | } |
| 41 | } |