Skip to content

Commit e506503

Browse files
authored
Merge branch 'geocoder-php:master' into master
2 parents 0b0fd74 + ce6ee28 commit e506503

File tree

10 files changed

+35
-17
lines changed

10 files changed

+35
-17
lines changed

.github/workflows/subtree.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
- { folder: Here, repository: here-provider }
8383
- { folder: HostIp, repository: host-ip-provider }
8484
- { folder: IP2Location, repository: ip2location-provider }
85-
# - { folder: IP2LocationBinary, repository: ip2location-binary-provider }
85+
- { folder: IP2LocationBinary, repository: ip2location-binary-provider }
8686
- { folder: IpInfo, repository: ip-info-provider }
8787
- { folder: IpInfoDb, repository: ip-info-db-provider }
8888
- { folder: Ipstack, repository: ipstack-provider }

src/Provider/BingMaps/BingMaps.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function getName(): string
8282
return 'bing_maps';
8383
}
8484

85-
private function executeQuery(string $url, ?string $locale = null, int $limit): Collection
85+
private function executeQuery(string $url, ?string $locale = null, int $limit = 1): Collection
8686
{
8787
if (null !== $locale) {
8888
$url = sprintf('%s&culture=%s', $url, str_replace('_', '-', $locale));

src/Provider/GeoIP2/Tests/GeoIP2AdapterTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,14 @@ protected function getGeoIP2ModelMock($geoIP2Model)
150150
'city' => [
151151
'geoname_id' => 2911298,
152152
'names' => [
153-
'de' => 'Hamburg',
154-
'en' => 'Hamburg',
155-
'es' => 'Hamburgo',
156-
'fr' => 'Hambourg',
157-
'ja' => 'ハンブルク',
158-
'pt-BR' => 'Hamburgo',
159-
'ru' => 'Гамбург',
160-
'zh-CN' => '汉堡市',
153+
'de' => 'Hamburg',
154+
'en' => 'Hamburg',
155+
'es' => 'Hamburgo',
156+
'fr' => 'Hambourg',
157+
'ja' => 'ハンブルク',
158+
'pt-BR' => 'Hamburgo',
159+
'ru' => 'Гамбург',
160+
'zh-CN' => '汉堡市',
161161
],
162162
],
163163
]

src/Provider/GoogleMaps/GoogleMaps.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ private function buildQuery(string $url, ?string $locale = null, ?string $region
197197
* @throws InvalidServerResponse
198198
* @throws InvalidCredentials
199199
*/
200-
private function fetchUrl(string $url, ?string $locale = null, int $limit, ?string $region = null): AddressCollection
200+
private function fetchUrl(string $url, ?string $locale = null, int $limit = 1, ?string $region = null): AddressCollection
201201
{
202202
$url = $this->buildQuery($url, $locale, $region);
203203
$content = $this->getUrlContents($url);

src/Provider/IP2LocationBinary/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
44

5+
## 1.3.1
6+
7+
### Changed
8+
9+
- Fix `utf8_encode()` deprecation[^1]
10+
511
## 1.3.0
612

713
### Added
@@ -40,3 +46,5 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee
4046
## 1.0.0
4147

4248
First release of this library.
49+
50+
[^1]: See https://www.php.net/manual/en/function.utf8-encode.php

src/Provider/IP2LocationBinary/IP2LocationBinary.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ public function geocodeQuery(GeocodeQuery $query): Collection
8181
Address::createFromArray([
8282
'providedBy' => $this->getName(),
8383
'countryCode' => $records['countryCode'],
84-
'country' => null === $records['countryName'] ? null : utf8_encode($records['countryName']),
84+
'country' => null === $records['countryName'] ? null : mb_convert_encoding($records['countryName'], 'UTF-8', 'ISO-8859-1'),
8585
'adminLevels' => $adminLevels,
86-
'locality' => null === $records['cityName'] ? null : utf8_encode($records['cityName']),
86+
'locality' => null === $records['cityName'] ? null : mb_convert_encoding($records['cityName'], 'UTF-8', 'ISO-8859-1'),
8787
'latitude' => $records['latitude'],
8888
'longitude' => $records['longitude'],
8989
'postalCode' => $records['zipCode'],

src/Provider/IP2LocationBinary/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"require": {
1515
"php": "^8.0",
1616
"ip2location/ip2location-php": "^8.1.1",
17+
"symfony/polyfill-mbstring": "^1.0",
1718
"willdurand/geocoder": "^4.0"
1819
},
1920
"provide": {
@@ -42,4 +43,4 @@
4243
"test": "vendor/bin/phpunit",
4344
"test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml"
4445
}
45-
}
46+
}

src/Provider/MaxMindBinary/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release.
44

5+
## 4.3.1
6+
7+
### Changed
8+
9+
- Fix `utf8_encode()` deprecation[^1]
10+
511
## 4.3.0
612

713
### Added
@@ -46,3 +52,5 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee
4652
## 4.0.0
4753

4854
First release of this library.
55+
56+
[^1]: See https://www.php.net/manual/en/function.utf8-encode.php

src/Provider/MaxMindBinary/MaxMindBinary.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ public function geocodeQuery(GeocodeQuery $query): Collection
9292
Address::createFromArray([
9393
'providedBy' => $this->getName(),
9494
'countryCode' => $geoIpRecord->country_code,
95-
'country' => null === $geoIpRecord->country_name ? null : utf8_encode($geoIpRecord->country_name),
95+
'country' => null === $geoIpRecord->country_name ? null : mb_convert_encoding($geoIpRecord->country_name, 'UTF-8', 'ISO-8859-1'),
9696
'adminLevels' => $adminLevels,
97-
'locality' => null === $geoIpRecord->city ? null : utf8_encode($geoIpRecord->city),
97+
'locality' => null === $geoIpRecord->city ? null : mb_convert_encoding($geoIpRecord->city, 'UTF-8', 'ISO-8859-1'),
9898
'latitude' => $geoIpRecord->latitude,
9999
'longitude' => $geoIpRecord->longitude,
100100
'postalCode' => $geoIpRecord->postal_code,

src/Provider/MaxMindBinary/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"require": {
1515
"php": "^8.0",
1616
"geoip/geoip": "^1.17",
17+
"symfony/polyfill-mbstring": "^1.0",
1718
"willdurand/geocoder": "^4.0"
1819
},
1920
"provide": {
@@ -42,4 +43,4 @@
4243
"test": "vendor/bin/phpunit",
4344
"test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml"
4445
}
45-
}
46+
}

0 commit comments

Comments
 (0)