Skip to content

Commit 91b2e0d

Browse files
committed
GeoIP2 results use underscore case
1 parent 0c852d1 commit 91b2e0d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Geocoder/Provider/GeoIP2.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,8 @@ public function geocode($address)
6767
'locality' => (isset($result->city->names->{$this->locale}) ? $result->city->names->{$this->locale} : null),
6868
'latitude' => (isset($result->location->latitude) ? $result->location->latitude : null),
6969
'longitude' => (isset($result->location->longitude) ? $result->location->longitude : null),
70-
'timezone' => (isset($result->location->timezone) ? $result->location->timezone : null),
71-
'postalCode' => (isset($result->location->postalcode) ? $result->location->postalcode : null),
70+
'timezone' => (isset($result->location->time_zone) ? $result->location->time_zone : null),
71+
'postalCode' => (isset($result->location->postal_code) ? $result->location->postal_code : null),
7272
'region' => $region,
7373
'regionCode' => $regionCode
7474
)))

tests/Geocoder/Tests/Provider/GeoIP2Test.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static function provideDataForRetrievingGeodata()
9494
'regionCode' => 'HH',
9595
'country' => 'Germany',
9696
'countryCode' => 'DE',
97-
'timezone' => null,
97+
'timezone' => 'Europe/Berlin',
9898
)
9999
),
100100
'Response with all data null' => array(

0 commit comments

Comments
 (0)