| Conditions | 3 |
| Paths | 3 |
| Total Lines | 11 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 4 |
| CRAP Score | 3.3332 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 47 | 1 | public function page(int $page_num, int $page_size): static |
|
| 48 | { |
||
| 49 | 1 | if ($page_size < 1) { |
|
| 50 | throw new InvalidArgumentException("page size out of range: {$page_size}"); |
||
| 51 | } |
||
| 52 | |||
| 53 | 1 | if ($page_num < 1) { |
|
| 54 | throw new InvalidArgumentException("page number out of range: {$page_num}"); |
||
| 55 | } |
||
| 56 | |||
| 57 | 1 | return $this->limit($page_size, ($page_num - 1) * $page_size); |
|
| 58 | } |
||
| 70 |