| Total Complexity | 2 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class PageScope implements Scope |
||
| 10 | { |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @var int |
||
| 14 | */ |
||
| 15 | private $page; |
||
| 16 | /** |
||
| 17 | * @var int |
||
| 18 | */ |
||
| 19 | private $perPage; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * PageScope constructor. |
||
| 23 | * @param int $page |
||
| 24 | * @param int $perPage |
||
| 25 | */ |
||
| 26 | 13 | public function __construct(int $page, int $perPage) |
|
| 27 | { |
||
| 28 | 13 | $this->page = $page; |
|
| 29 | 13 | $this->perPage = $perPage; |
|
| 30 | 13 | } |
|
| 31 | |||
| 32 | /** |
||
| 33 | * Apply the scope to a given Eloquent query builder. |
||
| 34 | * |
||
| 35 | * @param \Illuminate\Database\Eloquent\Builder $builder |
||
| 36 | * @param \Illuminate\Database\Eloquent\Model $model |
||
| 37 | * @return void |
||
| 38 | */ |
||
| 39 | 12 | public function apply(Builder $builder, Model $model) |
|
| 42 | 12 | } |
|
| 43 | } |
||
| 44 |