| Total Complexity | 3 |
| Total Lines | 66 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | final class Page implements IteratorAggregate |
||
| 14 | { |
||
| 15 | /** @var int */ |
||
| 16 | public $maxPerPage; |
||
| 17 | |||
| 18 | /** @var int */ |
||
| 19 | public $current; |
||
| 20 | |||
| 21 | /** @var int */ |
||
| 22 | public $total; |
||
| 23 | |||
| 24 | /** @var bool */ |
||
| 25 | public $hasNext; |
||
| 26 | |||
| 27 | /** @var bool */ |
||
| 28 | public $hasPrevious; |
||
| 29 | |||
| 30 | /** @var mixed */ |
||
| 31 | public $data; |
||
| 32 | |||
| 33 | /** @var Pagerfanta<mixed> */ |
||
| 34 | private Pagerfanta $pagerfanta; |
||
| 35 | |||
| 36 | /** @var callable */ |
||
| 37 | private $routeGenerator; |
||
| 38 | private ViewInterface $view; |
||
| 39 | |||
| 40 | /** @var array<string, mixed> */ |
||
| 41 | private array $viewOption; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @phpstan-param Pagerfanta<mixed> $pagerfanta |
||
| 45 | * @phpstan-param array<string, mixed> $viewOption |
||
| 46 | */ |
||
| 47 | public function __construct( |
||
| 57 | } |
||
| 58 | |||
| 59 | public function __toString(): string |
||
| 60 | { |
||
| 61 | return (string) $this->view->render( |
||
| 62 | $this->pagerfanta, |
||
| 63 | $this->routeGenerator, |
||
| 64 | $this->viewOption, |
||
| 65 | ); |
||
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * {@inheritDoc} |
||
| 70 | * |
||
| 71 | * @return Iterator<int, Page> |
||
| 72 | */ |
||
| 73 | public function getIterator(): Iterator |
||
| 79 | } |
||
| 80 | } |
||
| 81 |