Total Complexity | 7 |
Total Lines | 72 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
4 | class Pagination |
||
5 | { |
||
6 | /** @var int */ |
||
7 | private $page; |
||
8 | /** @var int */ |
||
9 | private $perPage; |
||
10 | /** @var int */ |
||
11 | private $totalItems; |
||
12 | /** @var int */ |
||
13 | private $totalPages; |
||
14 | /** @var null */ |
||
15 | private $links; |
||
16 | |||
17 | /** |
||
18 | * @param int $page |
||
19 | * @param int $perPage |
||
20 | * @param int $totalItems |
||
21 | * @param int $totalPages |
||
22 | * @param $links |
||
23 | */ |
||
24 | 8 | public function __construct($page, $perPage, $totalItems, $totalPages, $links = null) |
|
25 | { |
||
26 | 8 | $this->page = $page; |
|
27 | 8 | $this->perPage = $perPage; |
|
28 | 8 | $this->totalItems = $totalItems; |
|
29 | 8 | $this->totalPages = $totalPages; |
|
30 | 8 | $this->links = $links; |
|
31 | 8 | } |
|
32 | |||
33 | /** |
||
34 | * @return int |
||
35 | */ |
||
36 | 5 | public function getPage() |
|
37 | { |
||
38 | 5 | return $this->page; |
|
39 | } |
||
40 | |||
41 | /** |
||
42 | * @return int |
||
43 | */ |
||
44 | 5 | public function getPerPage() |
|
45 | { |
||
46 | 5 | return $this->perPage; |
|
47 | } |
||
48 | |||
49 | /** |
||
50 | * @return int |
||
51 | */ |
||
52 | 5 | public function getTotalItems() |
|
53 | { |
||
54 | 5 | return $this->totalItems; |
|
55 | } |
||
56 | |||
57 | /** |
||
58 | * @return int |
||
59 | */ |
||
60 | 5 | public function getTotalPages() |
|
61 | { |
||
62 | 5 | return $this->totalPages; |
|
63 | } |
||
64 | |||
65 | 1 | public function hasLinks() |
|
68 | } |
||
69 | |||
70 | /** |
||
71 | * @return PaginationLinks |
||
72 | */ |
||
73 | 4 | public function getLinks() |
|
76 | } |
||
77 | } |
||
78 |