Conditions | 3 |
Paths | 2 |
Total Lines | 19 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
22 | private function normalizeResponse($address) |
||
23 | { |
||
24 | if (sizeof($address) > 0 && strlen($address['address']) > 0) { |
||
25 | return [ |
||
26 | "status" => true, |
||
27 | "address" => $address["address"], |
||
28 | "district" => $address["district"], |
||
29 | "city" => $address["city"], |
||
30 | "state" => $address["state"], |
||
31 | "api" => "ApiCEP" |
||
32 | ]; |
||
33 | } else { |
||
34 | return [ |
||
35 | "status" => false, |
||
36 | "address" => null, |
||
37 | "district" => null, |
||
38 | "city" => null, |
||
39 | "state" => null, |
||
40 | "api" => "ApiCEP" |
||
41 | ]; |
||
44 | } |