Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
49 | protected function queryWithWhereIn($builder, array &$args = []) |
||
50 | { |
||
51 | if (isset($args['id'])) { |
||
52 | if (count($args['id']) === 1) { |
||
53 | $builder->where('id', reset($args['id'])); |
||
54 | } else { |
||
55 | $builder->whereIn('id', $args['id']); |
||
|
|||
56 | } |
||
57 | |||
58 | unset($args['id']); |
||
59 | } |
||
60 | |||
61 | return $builder; |
||
62 | } |
||
63 | } |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: