| Total Complexity | 5 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class Pagination extends Module |
||
| 9 | { |
||
| 10 | |||
| 11 | use StringFunctions; |
||
|
1 ignored issue
–
show
|
|||
| 12 | |||
| 13 | /** |
||
| 14 | * gets the pagination and returns the required information to set up previous / next pages |
||
| 15 | * @param string $page the page number in format "page-1" |
||
| 16 | * @param int $totalRows the total number of rows |
||
| 17 | * @param int $rowsPerPage the number of rows per page, by default, grabbed from the core constant file |
||
| 18 | * @return array the page number, the offset and the page total. |
||
| 19 | * @throws \Exception |
||
| 20 | */ |
||
| 21 | public function getPagination(string $page, int $totalRows, int $rowsPerPage = Constant::POSTS_PER_PAGE): array |
||
| 44 | } |