| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 33 | 3 | public function getLatLng($address) |
|
| 34 | { |
||
| 35 | 3 | $result = $this->geocode($address); |
|
| 36 | 3 | $result = json_decode($result, true); |
|
| 37 | |||
| 38 | 3 | if ($result['status'] !== 'OK') { |
|
| 39 | 1 | return; |
|
| 40 | } |
||
| 41 | |||
| 42 | 2 | $latLng = []; |
|
| 43 | 2 | foreach ($result['results'] as $result) { |
|
| 44 | 2 | $latLng[] = [ |
|
| 45 | 2 | 'lat' => $result['geometry']['location']['lat'], |
|
| 46 | 2 | 'lng' => $result['geometry']['location']['lng'], |
|
| 47 | ]; |
||
| 48 | } |
||
| 49 | |||
| 50 | 2 | return $latLng; |
|
| 51 | } |
||
| 52 | |||
| 86 |