Total Complexity | 2 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | final class LimitIterableAggregate implements IteratorAggregate |
||
24 | { |
||
25 | /** |
||
26 | * @var iterable<TKey, T> |
||
27 | */ |
||
28 | private iterable $iterable; |
||
29 | |||
30 | private int $limit; |
||
31 | |||
32 | private int $offset; |
||
33 | |||
34 | /** |
||
35 | * @param iterable<TKey, T> $iterable |
||
36 | */ |
||
37 | 1 | public function __construct(iterable $iterable, int $offset = 0, int $limit = -1) |
|
38 | { |
||
39 | 1 | $this->iterable = $iterable; |
|
40 | 1 | $this->offset = $offset; |
|
41 | 1 | $this->limit = $limit; |
|
42 | 1 | } |
|
43 | |||
44 | /** |
||
45 | * @return Generator<TKey, T> |
||
46 | */ |
||
47 | 1 | public function getIterator(): Traversable |
|
53 | ); |
||
54 | 1 | } |
|
56 |