Conditions | 4 |
Paths | 6 |
Total Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
18 | protected function escape(array $data): array |
||
19 | { |
||
20 | $arrayDot = array_filter(Arr::dot($data)); |
||
|
|||
21 | |||
22 | foreach ($arrayDot as $key => $value) { |
||
23 | if (is_string($value)) { |
||
24 | $arrayDot[$key] = e($value); |
||
25 | } |
||
26 | } |
||
27 | |||
28 | foreach ($arrayDot as $key => $value) { |
||
29 | Arr::set($data, $key, $value); |
||
30 | } |
||
31 | |||
32 | return $data; |
||
33 | } |
||
34 | |||
48 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: