Conditions | 1 |
Paths | 1 |
Total Lines | 10 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
38 | 12 | public function apply(Builder $builder, Model $model) |
|
39 | { |
||
40 | 12 | $start = $this->start; |
|
41 | 12 | $end = $this->end; |
|
42 | $builder |
||
43 | ->when(! is_null($start), function ($query) use ($start, $model) { |
||
44 | 10 | return $query->where($model->getKeyName(), '>', $start); |
|
45 | 12 | }) |
|
46 | ->when(! is_null($end), function ($query) use ($end, $model) { |
||
47 | 12 | return $query->where($model->getKeyName(), '<=', $end); |
|
48 | 12 | }); |
|
56 |