Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 1 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
15 | 4 | private function serializePaginator(Paginator $paginator, ?DataTransformerInterface $transformer = null): array |
|
16 | { |
||
17 | return [ |
||
18 | 4 | 'data' => $this->serializeItems(ArrayUtils::iteratorToArray($paginator->getCurrentItems()), $transformer), |
|
19 | 'pagination' => [ |
||
20 | 4 | 'currentPage' => $paginator->getCurrentPageNumber(), |
|
21 | 4 | 'pagesCount' => $paginator->count(), |
|
22 | 4 | 'itemsPerPage' => $paginator->getItemCountPerPage(), |
|
23 | 4 | 'itemsInCurrentPage' => $paginator->getCurrentItemCount(), |
|
24 | 4 | 'totalItems' => $paginator->getTotalItemCount(), |
|
25 | ], |
||
44 |