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