Skip to content

Commit 705808e

Browse files
committed
More tweaks
1 parent 4976d41 commit 705808e

File tree

4 files changed

+11
-13
lines changed

4 files changed

+11
-13
lines changed

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
},
1919
"require-dev": {
2020
"geoip2/geoip2": "~0.6",
21-
"symfony/stopwatch": "~2.5"
21+
"symfony/stopwatch": "~2.5",
22+
"ext-geoip": "*"
2223
},
2324
"suggest": {
2425
"ext-geoip": "Enabling the geoip extension allows you to use the MaxMindProvider.",

src/Geocoder/Model/AddressFactory.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -76,22 +76,16 @@ private function readStringValue(array $data, $key)
7676
}
7777

7878
/**
79-
* @return string
79+
* @return string|null
8080
*/
8181
private function valueOrNull($str)
8282
{
8383
return empty($str) ? null : $str;
8484
}
8585

86-
private function lowerize($str)
87-
{
88-
if (null !== $str = $this->valueOrNull($str)) {
89-
return extension_loaded('mbstring') ? mb_strtolower($str, 'UTF-8') : strtolower($str);
90-
}
91-
92-
return null;
93-
}
94-
86+
/**
87+
* @return string|null
88+
*/
9589
private function upperize($str)
9690
{
9791
if (null !== $str = $this->valueOrNull($str)) {

src/Geocoder/Provider/ArcGISOnline.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ public function getName()
146146
return 'arcgis_online';
147147
}
148148

149+
/**
150+
* @param string $query
151+
*/
149152
private function buildQuery($query)
150153
{
151154
if (null !== $this->sourceCountry) {

src/Geocoder/Provider/MaxMindBinary.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,14 @@ public function geocode($address)
8080
throw new NoResult(sprintf('No results found for IP address %s', $address));
8181
}
8282

83-
return array($this->fixEncoding(array_merge($this->getDefaults(), array(
83+
return [ array_merge($this->getDefaults(), [
8484
'countryCode' => $geoIpRecord->country_code,
8585
'country' => $geoIpRecord->country_name,
8686
'region' => $geoIpRecord->region,
8787
'locality' => $geoIpRecord->city,
8888
'latitude' => $geoIpRecord->latitude,
8989
'longitude' => $geoIpRecord->longitude,
90-
))));
90+
])];
9191
}
9292

9393
/**

0 commit comments

Comments
 (0)