Total Complexity | 8 |
Total Lines | 44 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class Positions implements Interfaces\IPositions |
||
10 | { |
||
11 | public const FIRST_PAGE = 1; |
||
12 | |||
13 | protected IPager $pager; |
||
14 | |||
15 | 22 | public function __construct(IPager $pager) |
|
16 | { |
||
17 | 22 | $this->pager = $pager; |
|
18 | 22 | } |
|
19 | |||
20 | 17 | public function nextPageExists(): bool |
|
21 | { |
||
22 | 17 | return $this->pager->pageExists($this->getNextPage()); |
|
23 | } |
||
24 | |||
25 | 17 | public function getNextPage(): int |
|
26 | { |
||
27 | 17 | return $this->pager->getActualPage() + 1; |
|
28 | } |
||
29 | |||
30 | 17 | public function prevPageExists(): bool |
|
31 | { |
||
32 | 17 | return $this->pager->pageExists($this->getPrevPage()); |
|
33 | } |
||
34 | |||
35 | 17 | public function getPrevPage(): int |
|
36 | { |
||
37 | 17 | return $this->pager->getActualPage() - 1; |
|
38 | } |
||
39 | |||
40 | 17 | public function getFirstPage(): int |
|
43 | } |
||
44 | |||
45 | 13 | public function getLastPage(): int |
|
46 | { |
||
47 | 13 | return $this->pager->getPagesCount(); |
|
48 | } |
||
49 | |||
50 | 21 | public function getPager(): IPager |
|
53 | } |
||
54 | } |
||
55 |