| Total Complexity | 6 |
| Total Lines | 38 |
| Duplicated Lines | 0 % |
| Coverage | 76.92% |
| 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 | 2 | public function __construct(string $name, ?int $default = null) |
|
| 22 | { |
||
| 23 | 2 | $this->name = $name; |
|
| 24 | 2 | $this->default = $default ?: (int) config('query-builder.per_page.value'); |
|
| 25 | 2 | } |
|
| 26 | |||
| 27 | 2 | public static function name(string $name, ?int $default = null): self |
|
| 30 | } |
||
| 31 | |||
| 32 | public function default(int $default): self |
||
| 37 | } |
||
| 38 | |||
| 39 | 2 | public function getName(): string |
|
| 40 | { |
||
| 41 | 2 | return $this->name; |
|
| 42 | } |
||
| 43 | |||
| 44 | 2 | public function getDefault(): int |
|
| 47 | } |
||
| 48 | } |
||
| 49 |