Total Complexity | 7 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | class Paginator |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | private $name; |
||
15 | |||
16 | /** |
||
17 | * @var int |
||
18 | */ |
||
19 | private $default; |
||
20 | |||
21 | public function __construct(?string $name = null, ?int $default = null) |
||
22 | { |
||
23 | $this->name = $name ?: (string) config('query-builder.per_page.key'); |
||
24 | $this->default = $default ?: (int) config('query-builder.per_page.value'); |
||
25 | } |
||
26 | |||
27 | public static function name(?string $name = null, ?int $default = null): self |
||
30 | } |
||
31 | |||
32 | public function default(int $default): self |
||
37 | } |
||
38 | |||
39 | public function getName(): string |
||
40 | { |
||
41 | return $this->name; |
||
42 | } |
||
43 | |||
44 | public function getDefault(): int |
||
47 | } |
||
48 | } |
||
49 |