Lines
100.00%
11 / 11
Functions and Methods
100.00%
1 / 1
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| PaginationFactory | 100.00% | 11 / 11 | 100.00% | 1 / 1 | 1 | 100.00% | 1 / 1 | |||
| createFromRequestInput | 100.00% | 11 / 11 | 100.00% | 1 / 1 | 1 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Districts\Editor\UI\Factory; | |
| 6 | ||
| 7 | use Districts\Editor\Domain\Pagination; | |
| 8 | ||
| 9 | class PaginationFactory | |
| 10 | { | |
| 11 | public function createFromRequestInput(?string $pageNumber): Pagination | |
| 12 | { | |
| 13 | $validPageNumber = filter_var( | |
| 14 | $pageNumber, | |
| 15 | FILTER_VALIDATE_INT, | |
| 16 | [ | |
| 17 | "options" => [ | |
| 18 | "default" => 1, | |
| 19 | "min_range" => 1, | |
| 20 | ], | |
| 21 | ] | |
| 22 | ); | |
| 23 | return new Pagination($validPageNumber, 20); | |
| 24 | } | |
| 25 | } |