Total Complexity | 7 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class Paginator |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | private $name; |
||
13 | |||
14 | /** |
||
15 | * @var int |
||
16 | */ |
||
17 | private $default; |
||
18 | |||
19 | 7 | public function __construct(?string $name = null, ?int $default = null) |
|
20 | { |
||
21 | 7 | $this->name = $name ?: QueryConfiguration::getPageName(); |
|
22 | 7 | $this->default = $default ?: QueryConfiguration::getPerPage(); |
|
23 | } |
||
24 | |||
25 | 7 | public static function name(?string $name = null, ?int $default = null): self |
|
28 | } |
||
29 | |||
30 | 2 | public function default(int $default): self |
|
35 | } |
||
36 | |||
37 | 7 | public function getName(): string |
|
38 | { |
||
39 | 7 | return $this->name; |
|
40 | } |
||
41 | |||
42 | 3 | public function getDefault(): int |
|
45 | } |
||
46 | } |
||
47 |