Skip to content

Commit f4d2ea7

Browse files
committed
fix providers
1 parent 079a64d commit f4d2ea7

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

src/Geocoder/Provider/AbstractProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ protected function getLocalhostDefaults()
111111
{
112112
return [
113113
'locality' => 'localhost',
114-
'region' => 'localhost',
115114
'county' => 'localhost',
115+
'region' => 'localhost',
116116
'country' => 'localhost',
117117
];
118118
}

src/Geocoder/Provider/ArcGISOnline.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ public function reverse($latitude, $longitude)
126126

127127
return $this->returnResults([
128128
array_merge($this->getDefaults(), [
129-
'latitude' => $coordinates[0],
130-
'longitude' => $coordinates[1],
129+
'latitude' => $latitude,
130+
'longitude' => $longitude,
131131
'streetName' => $streetName,
132132
'locality' => $city,
133133
'postalCode' => $zipcode,

src/Geocoder/Provider/GeoIP2.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private function executeQuery($address)
112112
$uri = sprintf('file://geoip?%s', $address);
113113

114114
try {
115-
$result = $this->adapter
115+
$result = $this->getAdapter()
116116
->setLocale($this->locale)
117117
->getContent($uri);
118118
} catch (AddressNotFoundException $e) {

src/Geocoder/Provider/HostIp.php

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,14 @@ private function executeQuery($query)
7777
throw new NoResult(sprintf('Could not execute query "%s".', $query));
7878
}
7979

80-
return array(array_merge($this->getDefaults(), array(
81-
'latitude' => $data['lat'],
82-
'longitude' => $data['lng'],
83-
'locality' => $data['city'],
84-
'country' => $data['country_name'],
85-
'countryCode' => $data['country_code'],
86-
)));
80+
return $this->returnResults([
81+
array_merge($this->getDefaults(), [
82+
'latitude' => $data['lat'],
83+
'longitude' => $data['lng'],
84+
'locality' => $data['city'],
85+
'country' => $data['country_name'],
86+
'countryCode' => $data['country_code'],
87+
])
88+
]);
8789
}
8890
}

0 commit comments

Comments
 (0)