Total Complexity | 4 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
22 | final class ChunkIterableAggregate implements IteratorAggregate |
||
23 | { |
||
24 | private int $chunkSize; |
||
25 | |||
26 | /** |
||
27 | * @var iterable<TKey, T> |
||
28 | */ |
||
29 | private iterable $iterable; |
||
30 | |||
31 | /** |
||
32 | * @param iterable<TKey, T> $iterable |
||
33 | */ |
||
34 | 1 | public function __construct(iterable $iterable, int $chunkSize) |
|
35 | { |
||
36 | 1 | $this->iterable = $iterable; |
|
37 | 1 | $this->chunkSize = $chunkSize; |
|
38 | } |
||
39 | |||
40 | /** |
||
41 | * @return Generator<int, list<T>> |
||
42 | */ |
||
43 | 1 | public function getIterator(): Generator |
|
60 | } |
||
61 | } |
||
62 |