| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 18 | 39 | protected function getResultsWithPagination( |
|
| 19 | string $query, |
||
| 20 | int $page, |
||
| 21 | 4 | int $perPage, |
|
| 22 | array $params, |
||
| 23 | int $total |
||
| 24 | ): array { |
||
| 25 | return [ |
||
| 26 | 'pagination' => [ |
||
| 27 | 'totalRows' => $total, |
||
| 28 | 'totalPages' => ceil($total / $perPage), |
||
| 29 | 'currentPage' => $page, |
||
| 30 | 4 | 'perPage' => $perPage, |
|
| 31 | 4 | ], |
|
| 32 | 4 | 'data' => $this->getResultByPage($query, $page, $perPage, $params), |
|
| 33 | 4 | ]; |
|
| 54 |