Conditions | 1 |
Paths | 1 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
9 | public function getAddressFromZipcode($zipCode) |
||
10 | { |
||
11 | $zipCode = preg_replace('/[^0-9]/im', '', $zipCode); |
||
12 | |||
13 | $zipCode = substr($zipCode, 0, 5) . "-" . substr($zipCode, 5); |
||
14 | |||
15 | $endPoint = "https://cdn.apicep.com/file/apicep/{$zipCode}.json"; |
||
16 | |||
17 | $content = @file_get_contents($endPoint); |
||
18 | |||
19 | $response = json_decode($content); |
||
|
|||
20 | |||
21 | return $this->normalizeResponse((array)$response); |
||
22 | } |
||
47 |