Conditions | 3 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
15 | 6 | protected function withPropertyConstraint(Builder $query, $value, $property): Builder |
|
16 | { |
||
17 | 6 | if (is_array($value)) { |
|
18 | 3 | return $query->where( |
|
19 | 3 | function ($query) use ($value, $property): void { |
|
20 | 3 | foreach ($value as $singleValue) { |
|
21 | 3 | $query->orWhere($property, 'like', sprintf('%%%s%%', $singleValue)); |
|
22 | } |
||
23 | 3 | } |
|
24 | ); |
||
25 | } |
||
26 | |||
27 | 3 | return $query->where($property, 'like', sprintf('%%%s%%', $value)); |
|
28 | } |
||
30 |