| Total Complexity | 5 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Coverage | 81.82% |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 7 | class PaginationParams |
||
| 8 | { |
||
| 9 | private array $config; |
||
| 10 | private Request $request; |
||
| 11 | |||
| 12 | public function __construct(array $config, Request $request) |
||
| 13 | { |
||
| 14 | 6 | $this->config = $config; |
|
| 15 | $this->request = $request; |
||
| 16 | 6 | } |
|
| 17 | 6 | ||
| 18 | 6 | public function perPage(int $default = null): ?int |
|
| 19 | { |
||
| 20 | 3 | return (int) $this->request->input("{$this->config['name']}.{$this->config['size']}", $default); |
|
| 21 | } |
||
| 22 | 3 | ||
| 23 | public function pageName(): string |
||
| 26 | } |
||
| 27 | |||
| 28 | public function page(int $default = null): ?int |
||
| 29 | { |
||
| 30 | 3 | return (int) $this->request->input("{$this->config['name']}.{$this->config['number']}", $default); |
|
| 31 | } |
||
| 32 | 3 | ||
| 33 | public function filled(): bool |
||
| 36 | } |
||
| 37 | } |
||
| 38 |