Conditions | 5 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
16 | 2 | public function getFiltered(array $filter = []): ApiResponse |
|
17 | { |
||
18 | 2 | $add_params = ''; |
|
19 | 2 | if (!empty($filter)) { |
|
20 | 2 | $filtered = []; |
|
21 | 2 | foreach ($filter as $k => $v) { |
|
22 | 2 | if (array_key_exists($k, Constants::OFFICE_FILTER)) { |
|
23 | 2 | $filtered[$k] = $v; |
|
24 | } |
||
25 | } |
||
26 | 2 | $filter = array_replace(Constants::OFFICE_FILTER, $filtered); |
|
27 | 2 | $add_params = empty($filter) ? '' : http_build_query($filter); |
|
28 | } |
||
29 | 2 | return $this->get($add_params); |
|
30 | } |
||
42 |