| Total Complexity | 2 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | class KendoScope implements Scope |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @var array |
||
| 19 | */ |
||
| 20 | public static $filters = [ |
||
| 21 | 'filter' => Filter::class, |
||
| 22 | 'group' => Group::class, |
||
| 23 | 'skip' => Skip::class, |
||
| 24 | 'sort' => Sort::class, |
||
| 25 | 'take' => Take::class, |
||
| 26 | ]; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Apply the scope to a given Eloquent query builder. |
||
| 30 | * |
||
| 31 | * @param Builder $builder |
||
| 32 | * @param Model $model |
||
| 33 | * @return \Illuminate\Database\Query\Builder|Builder |
||
| 34 | */ |
||
| 35 | public function apply(Builder $builder, Model $model) |
||
| 36 | { |
||
| 37 | return (new State($this->kendoRequest()))->filter($builder); |
||
|
|
|||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @return array |
||
| 42 | */ |
||
| 43 | protected function kendoRequest() |
||
| 48 | ) |
||
| 49 | ); |
||
| 52 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: