Total Complexity | 4 |
Total Lines | 26 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class PaginationSet |
||
12 | { |
||
13 | private OffsetPaginator $paginator; |
||
14 | private Closure $pageUrlGenerator; |
||
15 | |||
16 | public function __construct( |
||
17 | OffsetPaginator $paginator, |
||
18 | Closure $pageUrlGenerator |
||
19 | ) { |
||
20 | $this->paginator = $paginator; |
||
21 | $this->pageUrlGenerator = $pageUrlGenerator; |
||
22 | } |
||
23 | |||
24 | public function getPageUrl(int $page): string |
||
25 | { |
||
26 | return ($this->pageUrlGenerator)($page); |
||
27 | } |
||
28 | |||
29 | public function getPaginator(): OffsetPaginator |
||
30 | { |
||
31 | return $this->paginator; |
||
32 | } |
||
33 | |||
34 | public function needToPaginate(): bool |
||
37 | } |
||
38 | } |
||
39 |