| Total Complexity | 8 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | class CustomQueryAdapter extends QueryAdapter |
||
| 11 | { |
||
| 12 | private ?int $limit = null; |
||
| 13 | |||
| 14 | public function getNbResults(): int |
||
| 15 | { |
||
| 16 | if ($this->getLimit() !== null && parent::getNbResults() > $this->getLimit()) { |
||
| 17 | return $this->getLimit(); |
||
| 18 | } |
||
| 19 | |||
| 20 | return parent::getNbResults(); |
||
| 21 | } |
||
| 22 | |||
| 23 | public function setLimit(?int $limit) |
||
| 26 | } |
||
| 27 | |||
| 28 | public function getLimit(): ?int |
||
| 31 | } |
||
| 32 | |||
| 33 | public function getSlice($offset, $length): iterable |
||
| 40 | } |
||
| 41 | |||
| 42 | private function existsMoreItemsThanLimitation(int $offset, int $length): bool |
||
| 47 |