Total Complexity | 4 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 4 | ||
Bugs | 3 | Features | 0 |
1 | <?php |
||
22 | final class CachingIteratorAggregate implements IteratorAggregate |
||
23 | { |
||
24 | /** |
||
25 | * @var SimpleCachingIteratorAggregate<int, array{0: TKey, 1: T}> |
||
26 | */ |
||
27 | private SimpleCachingIteratorAggregate $iterator; |
||
28 | |||
29 | /** |
||
30 | * @param Iterator<TKey, T> $iterator |
||
31 | */ |
||
32 | 6 | public function __construct(Iterator $iterator) |
|
35 | } |
||
36 | |||
37 | /** |
||
38 | * @return Generator<TKey, T> |
||
39 | */ |
||
40 | 6 | public function getIterator(): Generator |
|
41 | { |
||
42 | 6 | foreach ($this->iterator as [$key, $current]) { |
|
43 | 6 | yield $key => $current; |
|
44 | } |
||
45 | } |
||
46 | |||
47 | 1 | public function hasNext(): bool |
|
50 | } |
||
51 | } |
||
52 |