@@ -38,9 +38,9 @@ discard block |
||
| 38 | 38 | * @return array |
| 39 | 39 | * @codeCoverageIgnore |
| 40 | 40 | */ |
| 41 | - public static function getCoordinates($address){ |
|
| 41 | + public static function getCoordinates($address) { |
|
| 42 | 42 | |
| 43 | - if(empty($address)) { |
|
| 43 | + if (empty($address)) { |
|
| 44 | 44 | return []; |
| 45 | 45 | } |
| 46 | 46 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $response = file_get_contents($url); |
| 53 | 53 | |
| 54 | 54 | //generate array object from the response from the web |
| 55 | - $json = json_decode($response,TRUE); |
|
| 55 | + $json = json_decode($response, TRUE); |
|
| 56 | 56 | |
| 57 | 57 | return [ |
| 58 | 58 | 'longitude' => $json['results'][0]['geometry']['location']['lng'], |
@@ -57,8 +57,8 @@ |
||
| 57 | 57 | foreach ($golfCoursesWithOutCoordinates as $golfCourse) { |
| 58 | 58 | $coordinates = GoogleCoordinatesService::getCoordinates($golfCourse->getName()); |
| 59 | 59 | if (!empty($coordinates)) { |
| 60 | - $golfCourse->setLatitude((string)$coordinates['latitude']); |
|
| 61 | - $golfCourse->setLongitude((string)$coordinates['longitude']); |
|
| 60 | + $golfCourse->setLatitude((string) $coordinates['latitude']); |
|
| 61 | + $golfCourse->setLongitude((string) $coordinates['longitude']); |
|
| 62 | 62 | $this->golfCourseRepository->update($golfCourse); |
| 63 | 63 | $this->golfCourseRepository->persistAll(); |
| 64 | 64 | } |