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