Conditions | 5 |
Paths | 4 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | 20 | protected function jsonColumn(Builder $query, Model $model, $column, $key) |
|
21 | { |
||
22 | 20 | $sql = $query->getQuery()->getGrammar()->wrap($column); |
|
23 | |||
24 | 20 | if ($model->getKeyName() === $key && in_array($model->getKeyType(), ['int', 'integer'])) { |
|
25 | 18 | $sql = '('.$sql.')::int'; |
|
26 | } |
||
27 | |||
28 | 20 | if ($model->hasCast($key) && $model->getCasts()[$key] === 'uuid') { |
|
29 | 2 | $sql = '('.$sql.')::uuid'; |
|
30 | } |
||
31 | |||
32 | 20 | return new Expression($sql); |
|
33 | } |
||
47 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.