We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Total Complexity | 5 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
17 | class SolrPaginator extends AbstractPaginator |
||
18 | { |
||
19 | /** |
||
20 | * @var SolrSearch |
||
21 | */ |
||
22 | private $solrSearch; |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | private $paginatedItems = []; |
||
28 | |||
29 | public function __construct( |
||
30 | SolrSearch $solrSearch, |
||
31 | int $currentPageNumber = 1, |
||
32 | int $itemsPerPage = 25 |
||
33 | ) { |
||
34 | $this->solrSearch = $solrSearch; |
||
35 | $this->setCurrentPageNumber($currentPageNumber); |
||
36 | $this->setItemsPerPage($itemsPerPage); |
||
37 | |||
38 | $this->updateInternalState(); |
||
39 | } |
||
40 | |||
41 | protected function updatePaginatedItems(int $itemsPerPage, int $offset): void |
||
42 | { |
||
43 | $this->solrSearch->submit($offset, $itemsPerPage); |
||
44 | $this->paginatedItems = $this->solrSearch->toArray(); |
||
45 | } |
||
46 | |||
47 | protected function getTotalAmountOfItems(): int |
||
50 | } |
||
51 | |||
52 | protected function getAmountOfItemsOnCurrentPage(): int |
||
55 | } |
||
56 | |||
57 | public function getPaginatedItems(): iterable |
||
60 | } |
||
61 | } |
||
62 |