| Total Complexity | 4 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 9 | class ImplicitLoopPaginator implements IteratorAggregate |
||
| 10 | { |
||
| 11 | /** @var Paginator */ |
||
| 12 | private $paginator; |
||
| 13 | /** @var callable */ |
||
| 14 | private $valueParser; |
||
| 15 | |||
| 16 | 21 | public function __construct(Paginator $paginator, callable $valueParser = null) |
|
| 17 | { |
||
| 18 | 21 | $this->paginator = $paginator; |
|
| 19 | $this->valueParser = $valueParser ?? function ($value) { |
||
| 20 | 20 | return $value; |
|
| 21 | 20 | }; |
|
| 22 | } |
||
| 23 | |||
| 24 | 21 | public function getIterator(): iterable |
|
| 35 | } |
||
| 36 | 21 | } while ($processedPages < $totalPages); |
|
| 39 |