| Total Complexity | 3 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class VisitsPaginatorAdapter extends AbstractCacheableCountPaginatorAdapter |
||
| 12 | { |
||
| 13 | private VisitRepositoryInterface $visitRepository; |
||
| 14 | private ShortUrlIdentifier $identifier; |
||
| 15 | private VisitsParams $params; |
||
| 16 | |||
| 17 | 4 | public function __construct( |
|
| 18 | VisitRepositoryInterface $visitRepository, |
||
| 19 | ShortUrlIdentifier $identifier, |
||
| 20 | VisitsParams $params |
||
| 21 | ) { |
||
| 22 | 4 | $this->visitRepository = $visitRepository; |
|
| 23 | 4 | $this->params = $params; |
|
| 24 | 4 | $this->identifier = $identifier; |
|
| 25 | 4 | } |
|
| 26 | |||
| 27 | 3 | public function getItems($offset, $itemCountPerPage): array // phpcs:ignore |
|
| 28 | { |
||
| 29 | 3 | return $this->visitRepository->findVisitsByShortCode( |
|
| 30 | 3 | $this->identifier->shortCode(), |
|
| 31 | 3 | $this->identifier->domain(), |
|
| 32 | 3 | $this->params->getDateRange(), |
|
| 33 | $itemCountPerPage, |
||
| 34 | $offset, |
||
| 35 | ); |
||
| 36 | } |
||
| 37 | |||
| 38 | 3 | protected function doCount(): int |
|
| 44 | ); |
||
| 45 | } |
||
| 46 | } |
||
| 47 |