Conditions | 1 |
Paths | 1 |
Total Lines | 11 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
21 | 2 | public function osmCheckCoordinates($longitude, $latitude) |
|
22 | { |
||
23 | 2 | $url = ($this->baseUrl . $this->accessKey . "&format=json&lat=" . $latitude . "&lon=" . $longitude . "&addressdetails=1"); |
|
24 | 2 | $cURL = new CURL; |
|
25 | 2 | $result = $cURL->req($url); |
|
26 | 2 | $result = json_decode($result); |
|
27 | |||
28 | 2 | $country = $result->address->country ?? ""; |
|
29 | 2 | $town = $result->address->town ?? ""; |
|
30 | |||
31 | 2 | return array($country, $town); |
|
32 | } |
||
34 |