Conditions | 4 |
Paths | 4 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
25 | 6 | private function parseFilter(array $filter = []): string |
|
26 | { |
||
27 | 6 | $add_params = ''; |
|
28 | 6 | if (empty($filter)) { |
|
29 | 1 | return $add_params; |
|
30 | } |
||
31 | |||
32 | 5 | $filtered = []; |
|
33 | 5 | foreach ($filter as $k => $v) { |
|
34 | 5 | if (array_key_exists($k, self::FILTER)) { |
|
|
|||
35 | 5 | $filtered[$k] = $v; |
|
36 | } |
||
37 | } |
||
38 | 5 | $add_params = http_build_query($filtered); |
|
39 | 5 | return $add_params; |
|
40 | } |
||
52 |