| Conditions | 3 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | protected function applySort($inputs, $sorts) |
||
|
|
|||
| 19 | { |
||
| 20 | foreach (['desc', 'asc'] as $direction) { |
||
| 21 | $this->when($this->request->input($direction), |
||
| 22 | function (Builder $query, $descAttribute) use ($sorts, $direction) { |
||
| 23 | if (array_key_exists($descAttribute, $sorts)) { |
||
| 24 | $descAttribute = Arr::get($sorts, $descAttribute); |
||
| 25 | } |
||
| 26 | |||
| 27 | return $query->orderBy($descAttribute, $direction); |
||
| 28 | } |
||
| 29 | ); |
||
| 30 | } |
||
| 31 | |||
| 32 | return $this; |
||
| 33 | } |
||
| 35 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.