Conditions | 5 |
Paths | 1 |
Total Lines | 18 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
17 | public static function build($params) |
||
18 | { |
||
19 | return collect($params) |
||
20 | ->reject(function ($value) { |
||
21 | return blank($value); |
||
22 | })->transform(function ($value, $key) { |
||
23 | if ('ids' === $key) { |
||
24 | return $value !== 'recently-active' ? static::wrap($value) : $value; |
||
25 | } |
||
26 | |||
27 | if (is_string($value)) { // Encode if it's not UTF-8 |
||
28 | if (mb_detect_encoding($value, 'auto') !== 'UTF-8') { |
||
29 | return mb_convert_encoding($value, 'UTF-8'); |
||
30 | } |
||
31 | } |
||
32 | |||
33 | return $value; |
||
34 | })->toArray(); |
||
35 | } |
||
54 |