diff --git a/.github/workflows/subtree.yml b/.github/workflows/subtree.yml index 7e7b87017..4b845c7a6 100644 --- a/.github/workflows/subtree.yml +++ b/.github/workflows/subtree.yml @@ -19,7 +19,7 @@ jobs: name: Subtree for Common runs-on: ubuntu-latest steps: - - uses: actions/create-github-app-token@v1 + - uses: actions/create-github-app-token@v2 id: app-token with: app-id: ${{ vars.SUBTREE_APP_ID }} @@ -39,7 +39,7 @@ jobs: name: Subtree for Http runs-on: ubuntu-latest steps: - - uses: actions/create-github-app-token@v1 + - uses: actions/create-github-app-token@v2 id: app-token with: app-id: ${{ vars.SUBTREE_APP_ID }} @@ -59,7 +59,7 @@ jobs: name: Subtree for Plugin runs-on: ubuntu-latest steps: - - uses: actions/create-github-app-token@v1 + - uses: actions/create-github-app-token@v2 id: app-token with: app-id: ${{ vars.SUBTREE_APP_ID }} @@ -119,7 +119,7 @@ jobs: - { folder: TomTom, repository: tomtom-provider } - { folder: Yandex, repository: yandex-provider } steps: - - uses: actions/create-github-app-token@v1 + - uses: actions/create-github-app-token@v2 id: app-token with: app-id: ${{ vars.SUBTREE_APP_ID }} diff --git a/src/Common/composer.json b/src/Common/composer.json index fd4348f60..122e72eca 100644 --- a/src/Common/composer.json +++ b/src/Common/composer.json @@ -22,7 +22,7 @@ "require-dev": { "nyholm/nsa": "^1.1", "phpunit/phpunit": "^9.5", - "symfony/stopwatch": "~2.5 || ~5.0" + "symfony/stopwatch": "~2.5 || ~5.0 || ~7.0" }, "suggest": { "symfony/stopwatch": "If you want to use the TimedGeocoder" diff --git a/src/Http/CHANGELOG.md b/src/Http/CHANGELOG.md index d0fb5053c..552356831 100644 --- a/src/Http/CHANGELOG.md +++ b/src/Http/CHANGELOG.md @@ -2,9 +2,20 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.7.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 4.6.0 +### Removed + - Drop support for PHP 7 + +### Changed + - Make PSR-17 a first class citizen ## 4.5.0 diff --git a/src/Plugin/CHANGELOG.md b/src/Plugin/CHANGELOG.md index 7cc855164..03e89bc8a 100644 --- a/src/Plugin/CHANGELOG.md +++ b/src/Plugin/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 1.6.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 1.5.0 ### Added diff --git a/src/Provider/AlgoliaPlaces/CHANGELOG.md b/src/Provider/AlgoliaPlaces/CHANGELOG.md index aa56443cd..1c504ab06 100644 --- a/src/Provider/AlgoliaPlaces/CHANGELOG.md +++ b/src/Provider/AlgoliaPlaces/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 0.5.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 0.4.0 ### Added diff --git a/src/Provider/AlgoliaPlaces/Tests/AlgoliaPlacesTest.php b/src/Provider/AlgoliaPlaces/Tests/AlgoliaPlacesTest.php index 9428a45c6..31ca5b192 100644 --- a/src/Provider/AlgoliaPlaces/Tests/AlgoliaPlacesTest.php +++ b/src/Provider/AlgoliaPlaces/Tests/AlgoliaPlacesTest.php @@ -47,12 +47,12 @@ public function testGeocodeQueryWithLocale(): void $provider = new AlgoliaPlaces($this->getHttpClient($_SERVER['ALGOLIA_API_KEY'], $_SERVER['ALGOLIA_APP_ID']), $_SERVER['ALGOLIA_API_KEY'], $_SERVER['ALGOLIA_APP_ID']); $results = $provider->geocodeQuery(GeocodeQuery::create('10 avenue Gambetta, Paris, France')->withLocale('fr-FR')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(48.8653, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.39844, $result->getCoordinates()->getLongitude(), 0.01); @@ -72,12 +72,12 @@ public function testGeocodeQueryWithoutLocale(): void $provider = new AlgoliaPlaces($this->getHttpClient($_SERVER['ALGOLIA_API_KEY'], $_SERVER['ALGOLIA_APP_ID']), $_SERVER['ALGOLIA_API_KEY'], $_SERVER['ALGOLIA_APP_ID']); $results = $provider->geocodeQuery(GeocodeQuery::create('Paris, France')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(20, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(48.8546, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.34771, $result->getCoordinates()->getLongitude(), 0.01); @@ -93,7 +93,7 @@ public function testGeocodeUnauthenticated(): void $provider = new AlgoliaPlaces($this->getHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('Paris, France')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(20, $results); } diff --git a/src/Provider/AlgoliaPlaces/composer.json b/src/Provider/AlgoliaPlaces/composer.json index 8c38cc0a9..a1bd01e7a 100644 --- a/src/Provider/AlgoliaPlaces/composer.json +++ b/src/Provider/AlgoliaPlaces/composer.json @@ -15,7 +15,7 @@ "php": "^8.0", "ext-json": "*", "geocoder-php/common-http": "^4.6", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/ArcGISOnline/CHANGELOG.md b/src/Provider/ArcGISOnline/CHANGELOG.md index 3eff87a74..a06cee27c 100644 --- a/src/Provider/ArcGISOnline/CHANGELOG.md +++ b/src/Provider/ArcGISOnline/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.5.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 4.4.0 ### Added diff --git a/src/Provider/ArcGISOnline/Tests/ArcGISOnlineTest.php b/src/Provider/ArcGISOnline/Tests/ArcGISOnlineTest.php index c8d0f760c..b202df83a 100644 --- a/src/Provider/ArcGISOnline/Tests/ArcGISOnlineTest.php +++ b/src/Provider/ArcGISOnline/Tests/ArcGISOnlineTest.php @@ -55,12 +55,12 @@ public function testGeocodeWithRealAddress(): void $provider = new ArcGISOnline($this->getHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('10 avenue Gambetta, Paris, France')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(48.863279997000461, $result->getCoordinates()->getLatitude(), 0.0001); $this->assertEqualsWithDelta(2.3890199980004354, $result->getCoordinates()->getLongitude(), 0.0001); $this->assertEquals(10, $result->getStreetNumber()); @@ -88,11 +88,11 @@ public function testGeocodeWithToken(): void $provider = ArcGISOnline::token($this->getHttpClient($_SERVER['ARCGIS_TOKEN']), $_SERVER['ARCGIS_TOKEN']); $results = $provider->geocodeQuery(GeocodeQuery::create('5754 WI-23, Spring Green, WI 53588, USA')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(43.093663, $result->getCoordinates()->getLatitude(), 0.0001); $this->assertEqualsWithDelta(-90.131796, $result->getCoordinates()->getLongitude(), 0.0001); $this->assertEquals(5754, $result->getStreetNumber()); @@ -126,12 +126,12 @@ public function testReverseWithRealCoordinates(): void $provider = new ArcGISOnline($this->getHttpClient(), null); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(48.863279997000461, 2.3890199980004354)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(48.863279997000461, $result->getCoordinates()->getLatitude(), 0.0001); $this->assertEqualsWithDelta(2.3890199980004354, $result->getCoordinates()->getLongitude(), 0.0001); $this->assertNull($result->getStreetNumber()); @@ -152,12 +152,12 @@ public function testGeocodeWithCity(): void $provider = new ArcGISOnline($this->getHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('Hannover')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(52.37227000000007, $result->getCoordinates()->getLatitude(), 0.0001); $this->assertEqualsWithDelta(9.738150000000076, $result->getCoordinates()->getLongitude(), 0.0001); $this->assertNull($result->getStreetNumber()); @@ -175,7 +175,7 @@ public function testGeocodeWithCity(): void /** @var Location $result */ $result = $results->get(1); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(39.391768472000479, $result->getCoordinates()->getLatitude(), 0.0001); $this->assertEqualsWithDelta(-77.440257128999633, $result->getCoordinates()->getLongitude(), 0.0001); $this->assertNull($result->getStreetName()); @@ -186,7 +186,7 @@ public function testGeocodeWithCity(): void /** @var Location $result */ $result = $results->get(2); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(53.174198173, $result->getCoordinates()->getLatitude(), 0.0001); $this->assertEqualsWithDelta(8.5069383810005, $result->getCoordinates()->getLongitude(), 0.0001); $this->assertNull($result->getStreetName()); @@ -197,7 +197,7 @@ public function testGeocodeWithCity(): void /** @var Location $result */ $result = $results->get(3); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(47.111290000000054, $result->getCoordinates()->getLatitude(), 0.0001); $this->assertEqualsWithDelta(-101.42142999999999, $result->getCoordinates()->getLongitude(), 0.0001); $this->assertNull($result->getStreetName()); @@ -208,7 +208,7 @@ public function testGeocodeWithCity(): void /** @var Location $result */ $result = $results->get(4); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(32.518790000000024, $result->getCoordinates()->getLatitude(), 0.0001); $this->assertEqualsWithDelta(-90.06298999999996, $result->getCoordinates()->getLongitude(), 0.0001); $this->assertNull($result->getStreetName()); diff --git a/src/Provider/ArcGISOnline/composer.json b/src/Provider/ArcGISOnline/composer.json index 3775976ad..fce26fea7 100644 --- a/src/Provider/ArcGISOnline/composer.json +++ b/src/Provider/ArcGISOnline/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/AzureMaps/AzureMaps.php b/src/Provider/AzureMaps/AzureMaps.php index 85af12d99..e88a8caa9 100644 --- a/src/Provider/AzureMaps/AzureMaps.php +++ b/src/Provider/AzureMaps/AzureMaps.php @@ -225,6 +225,7 @@ private function formatGeocodeResponse(\stdClass $response): array $builder->setCountryCode($result->address->countryCode ?? null); $builder->setCountry($result->address->country ?? null); $builder->setPostalCode($result->address->extendedPostalCode ?? null); + $builder->setLocality($result->address->municipality ?? null); return $builder->build(); }, $response->results); diff --git a/src/Provider/AzureMaps/CHANGELOG.md b/src/Provider/AzureMaps/CHANGELOG.md index 27482155f..c9b7015a5 100644 --- a/src/Provider/AzureMaps/CHANGELOG.md +++ b/src/Provider/AzureMaps/CHANGELOG.md @@ -2,6 +2,18 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 1.3.0 + +### Added + +- Add support for PHP 8.2, 8.3, and 8.4 +- Add support for municipality +- Add support for PHP Geocoder 5 + +### Removed + +- Drop support for PHP 7.4 + ## 1.2.0 ### Added diff --git a/src/Provider/AzureMaps/Tests/.cached_responses/atlas.microsoft.com_69d8503bda88693f2c4f5afa40c80a2cbb5f5dde b/src/Provider/AzureMaps/Tests/.cached_responses/atlas.microsoft.com_69d8503bda88693f2c4f5afa40c80a2cbb5f5dde new file mode 100644 index 000000000..2e5712dd2 --- /dev/null +++ b/src/Provider/AzureMaps/Tests/.cached_responses/atlas.microsoft.com_69d8503bda88693f2c4f5afa40c80a2cbb5f5dde @@ -0,0 +1 @@ +s:3807:"{"summary":{"query":"via giuseppe garibaldi 62 it italy","queryType":"NON_NEAR","queryTime":159,"numResults":5,"offset":0,"totalResults":735,"fuzzyLevel":1},"results":[{"type":"Point Address","id":"M10ReRZ2hcOXh-6Zf0J61w","score":0.9898217893889455,"matchConfidence":{"score":0.9898217893889455},"address":{"streetNumber":"62","streetName":"Via Giuseppe Garibaldi","municipality":"Scisciano","countrySecondarySubdivision":"Naples","countrySubdivision":"Campania","countrySubdivisionName":"Campania","countrySubdivisionCode":"72","postalCode":"80030","countryCode":"IT","country":"Italy","countryCodeISO3":"ITA","freeformAddress":"Via Giuseppe Garibaldi 62, 80030 Scisciano","localName":"Scisciano"},"position":{"lat":40.9178377,"lon":14.4925806},"viewport":{"topLeftPoint":{"lat":40.91874,"lon":14.49139},"btmRightPoint":{"lat":40.91694,"lon":14.49377}},"entryPoints":[{"type":"main","position":{"lat":40.91789,"lon":14.49264}}]},{"type":"Point Address","id":"sjVXib68Vk_apQocqTtcNw","score":1,"matchConfidence":{"score":1},"address":{"streetNumber":"62","streetName":"Via Giuseppe Garibaldi","municipality":"Rieti","countrySecondarySubdivision":"Rieti","countrySubdivision":"Lazio","countrySubdivisionName":"Lazio","countrySubdivisionCode":"62","postalCode":"02100","countryCode":"IT","country":"Italy","countryCodeISO3":"ITA","freeformAddress":"Via Giuseppe Garibaldi 62, 02100 Rieti","localName":"Rieti"},"position":{"lat":42.4045777,"lon":12.8696648},"viewport":{"topLeftPoint":{"lat":42.40548,"lon":12.86845},"btmRightPoint":{"lat":42.40368,"lon":12.87088}},"entryPoints":[{"type":"main","position":{"lat":42.40462,"lon":12.86965}}]},{"type":"Point Address","id":"4141RKh-zp9rGny90SkbJA","score":1,"matchConfidence":{"score":1},"address":{"streetNumber":"62","streetName":"Via Giuseppe Garibaldi","municipality":"Lariano","countrySecondarySubdivision":"Rome","countrySubdivision":"Lazio","countrySubdivisionName":"Lazio","countrySubdivisionCode":"62","postalCode":"00076","countryCode":"IT","country":"Italy","countryCodeISO3":"ITA","freeformAddress":"Via Giuseppe Garibaldi 62, 00076 Lariano","localName":"Lariano"},"position":{"lat":41.7242695,"lon":12.8408613},"viewport":{"topLeftPoint":{"lat":41.72517,"lon":12.83966},"btmRightPoint":{"lat":41.72337,"lon":12.84207}},"entryPoints":[{"type":"main","position":{"lat":41.72427,"lon":12.84089}}]},{"type":"Point Address","id":"tDn3fkOIetRlG1216sBV9g","score":1,"matchConfidence":{"score":1},"address":{"streetNumber":"62","streetName":"Via Giuseppe Garibaldi","municipality":"Sabaudia","countrySecondarySubdivision":"Latina","countrySubdivision":"Lazio","countrySubdivisionName":"Lazio","countrySubdivisionCode":"62","postalCode":"04016","countryCode":"IT","country":"Italy","countryCodeISO3":"ITA","freeformAddress":"Via Giuseppe Garibaldi 62, 04016 Sabaudia","localName":"Sabaudia"},"position":{"lat":41.2971023,"lon":13.0370044},"viewport":{"topLeftPoint":{"lat":41.298,"lon":13.03581},"btmRightPoint":{"lat":41.2962,"lon":13.0382}},"entryPoints":[{"type":"main","position":{"lat":41.29718,"lon":13.03701}}]},{"type":"Point Address","id":"QI_uwItbuz6PB3ifaRIKVA","score":1,"matchConfidence":{"score":1},"address":{"streetNumber":"62","streetName":"Via Giuseppe Garibaldi","municipality":"Genzano di Roma","countrySecondarySubdivision":"Rome","countrySubdivision":"Lazio","countrySubdivisionName":"Lazio","countrySubdivisionCode":"62","postalCode":"00045","countryCode":"IT","country":"Italy","countryCodeISO3":"ITA","freeformAddress":"Via Giuseppe Garibaldi 62, 00045 Genzano di Roma","localName":"Genzano di Roma"},"position":{"lat":41.7081063,"lon":12.6897159},"viewport":{"topLeftPoint":{"lat":41.70901,"lon":12.68851},"btmRightPoint":{"lat":41.70721,"lon":12.69092}},"entryPoints":[{"type":"main","position":{"lat":41.70807,"lon":12.68968}}]}]}"; \ No newline at end of file diff --git a/src/Provider/AzureMaps/Tests/AzureMapsTest.php b/src/Provider/AzureMaps/Tests/AzureMapsTest.php index e23e99b1e..0776c83ea 100644 --- a/src/Provider/AzureMaps/Tests/AzureMapsTest.php +++ b/src/Provider/AzureMaps/Tests/AzureMapsTest.php @@ -93,4 +93,25 @@ public function testReverseWithRealCoordinates(): void $this->assertEquals('Israel', $result->getCountry()->getName()); $this->assertEquals('IL', $result->getCountry()->getCode()); } + + public function testGeocodeIncludesMunicipality(): void + { + if (!isset($_SERVER['AZURE_MAPS_SUBSCRIPTION_KEY'])) { + $this->markTestSkipped('You need to configure the AZURE_MAPS_SUBSCRIPTION_KEY value in phpunit.xml'); + } + + $subscriptionKey = $_SERVER['AZURE_MAPS_SUBSCRIPTION_KEY']; + $provider = new AzureMaps($this->getHttpClient($subscriptionKey), $subscriptionKey); + + $results = $provider->geocodeQuery(GeocodeQuery::create('Via Giuseppe Garibaldi 62, IT, Italy')); + + $this->assertInstanceOf(AddressCollection::class, $results); + $this->assertGreaterThan(0, $results->count(), 'No results found'); + + $result = $results->first(); + + $this->assertInstanceOf(Address::class, $result); + $this->assertNotNull($result->getLocality(), 'Municipality (city) is missing in the response'); + $this->assertEquals('Scisciano', $result->getLocality()); + } } diff --git a/src/Provider/AzureMaps/composer.json b/src/Provider/AzureMaps/composer.json index a72fd7d70..9e00d0917 100644 --- a/src/Provider/AzureMaps/composer.json +++ b/src/Provider/AzureMaps/composer.json @@ -13,7 +13,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/BingMaps/CHANGELOG.md b/src/Provider/BingMaps/CHANGELOG.md index fd68bf7ce..f3d6f2677 100644 --- a/src/Provider/BingMaps/CHANGELOG.md +++ b/src/Provider/BingMaps/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.4.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 4.3.0 ### Added diff --git a/src/Provider/BingMaps/Tests/BingMapsTest.php b/src/Provider/BingMaps/Tests/BingMapsTest.php index 7efad170e..dc93b5ec1 100644 --- a/src/Provider/BingMaps/Tests/BingMapsTest.php +++ b/src/Provider/BingMaps/Tests/BingMapsTest.php @@ -70,12 +70,12 @@ public function testGeocodeReturnsMultipleResults(): void $provider = new BingMaps($this->getMockedHttpClient($json), 'api_key'); $results = $provider->geocodeQuery(GeocodeQuery::create('10 avenue Gambetta, Paris, France')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(3, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(48.86321675999999, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.3887721299999995, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -97,7 +97,7 @@ public function testGeocodeReturnsMultipleResults(): void /** @var Location $result */ $result = $results->get(1); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(48.81342781, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.32503767, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -117,7 +117,7 @@ public function testGeocodeReturnsMultipleResults(): void /** @var Location $result */ $result = $results->get(2); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(48.81014147, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.43568048, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -145,12 +145,12 @@ public function testReverseReturnsSingleResult(): void $provider = new BingMaps($this->getMockedHttpClient($json), 'api_key'); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(48.86321648955345, 2.3887719959020615)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(48.86321648955345, $result->getCoordinates()->getLatitude(), 0.0001); $this->assertEqualsWithDelta(2.3887719959020615, $result->getCoordinates()->getLongitude(), 0.0001); $this->assertNotNull($result->getBounds()); @@ -180,12 +180,12 @@ public function testGeocodeWithRealAddressReturnsSingleResults(): void $provider = new BingMaps($this->getHttpClient($_SERVER['BINGMAPS_API_KEY']), $_SERVER['BINGMAPS_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('10 avenue Gambetta, Paris, France')->withLocale('fr-FR')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(48.86321675999999, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.3887721299999995, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -217,7 +217,7 @@ public function testGeocodeWithRealAddressReturnsMultipleResults(): void $provider = new BingMaps($this->getHttpClient($_SERVER['BINGMAPS_API_KEY']), $_SERVER['BINGMAPS_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('Castelnuovo, Italie')->withLocale('fr-FR')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); } @@ -230,12 +230,12 @@ public function testReverseWithRealCoordinatesReturnsSingleResult(): void $provider = new BingMaps($this->getHttpClient($_SERVER['BINGMAPS_API_KEY']), $_SERVER['BINGMAPS_API_KEY']); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(48.86321648955345, 2.3887719959020615)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(48.86321648955345, $result->getCoordinates()->getLatitude(), 0.0001); $this->assertEqualsWithDelta(2.3887719959020615, $result->getCoordinates()->getLongitude(), 0.0001); $this->assertNotNull($result->getBounds()); diff --git a/src/Provider/BingMaps/composer.json b/src/Provider/BingMaps/composer.json index 5a1e0c8a5..6e9da4695 100644 --- a/src/Provider/BingMaps/composer.json +++ b/src/Provider/BingMaps/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/Cache/CHANGELOG.md b/src/Provider/Cache/CHANGELOG.md index 6c0610a30..5422c1439 100644 --- a/src/Provider/Cache/CHANGELOG.md +++ b/src/Provider/Cache/CHANGELOG.md @@ -2,6 +2,13 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.5.0 + +### Added + +- Add support for PHP Geocoder 5 +- Add support for PHP 8.2, 8.3, 8.4 + ## 4.4.0 ### Added diff --git a/src/Provider/Cache/composer.json b/src/Provider/Cache/composer.json index cd9e28e4e..8d025a08c 100644 --- a/src/Provider/Cache/composer.json +++ b/src/Provider/Cache/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "psr/simple-cache": "^1.0|^2.0|^3.0", - "willdurand/geocoder": "^4.0.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/Chain/CHANGELOG.md b/src/Provider/Chain/CHANGELOG.md index 35a84e1f1..62f8eed21 100644 --- a/src/Provider/Chain/CHANGELOG.md +++ b/src/Provider/Chain/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.6.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 4.5.0 ### Changed diff --git a/src/Provider/Chain/Tests/ChainTest.php b/src/Provider/Chain/Tests/ChainTest.php index 230986c4e..eaf5f4773 100644 --- a/src/Provider/Chain/Tests/ChainTest.php +++ b/src/Provider/Chain/Tests/ChainTest.php @@ -27,7 +27,7 @@ class ChainTest extends TestCase { public function testAdd(): void { - $mock = $this->getMockBuilder('Geocoder\Provider\Provider')->getMock(); + $mock = $this->getMockBuilder(Provider::class)->getMock(); $chain = new Chain(); $chain->add($mock); @@ -49,7 +49,7 @@ public function testReverse(): void throw new \Exception(); })); - $mockTwo = $this->getMockBuilder('Geocoder\\Provider\\Provider')->getMock(); + $mockTwo = $this->getMockBuilder(Provider::class)->getMock(); $result = new AddressCollection(['foo' => 'bar']); $mockTwo->expects($this->once()) ->method('reverseQuery') @@ -63,14 +63,14 @@ public function testReverse(): void public function testGeocode(): void { $query = GeocodeQuery::create('Paris'); - $mockOne = $this->getMockBuilder('Geocoder\\Provider\\Provider')->getMock(); + $mockOne = $this->getMockBuilder(Provider::class)->getMock(); $mockOne->expects($this->once()) ->method('geocodeQuery') ->will($this->returnCallback(function () { throw new \Exception(); })); - $mockTwo = $this->getMockBuilder('Geocoder\\Provider\\Provider')->getMock(); + $mockTwo = $this->getMockBuilder(Provider::class)->getMock(); $result = new AddressCollection(['foo' => 'bar']); $mockTwo->expects($this->once()) ->method('geocodeQuery') diff --git a/src/Provider/Chain/composer.json b/src/Provider/Chain/composer.json index 078e818a9..b3fdb9ce6 100644 --- a/src/Provider/Chain/composer.json +++ b/src/Provider/Chain/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "psr/log": "^1.0|^2.0|^3.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/FreeGeoIp/CHANGELOG.md b/src/Provider/FreeGeoIp/CHANGELOG.md index 01a6ab81f..dce3d88e4 100644 --- a/src/Provider/FreeGeoIp/CHANGELOG.md +++ b/src/Provider/FreeGeoIp/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.6.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 4.5.0 ### Added diff --git a/src/Provider/FreeGeoIp/Tests/FreeGeoIpTest.php b/src/Provider/FreeGeoIp/Tests/FreeGeoIpTest.php index 4c4eacc44..b0444d401 100644 --- a/src/Provider/FreeGeoIp/Tests/FreeGeoIpTest.php +++ b/src/Provider/FreeGeoIp/Tests/FreeGeoIpTest.php @@ -45,12 +45,12 @@ public function testGeocodeWithLocalhostIPv4(): void $provider = $this->getProvider(); $results = $provider->geocodeQuery(GeocodeQuery::create('127.0.0.1')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('localhost', $result->getLocality()); $this->assertEquals('localhost', $result->getCountry()->getName()); } @@ -60,12 +60,12 @@ public function testGeocodeWithLocalhostIPv6(): void $provider = $this->getProvider(); $results = $provider->geocodeQuery(GeocodeQuery::create('::1')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('localhost', $result->getLocality()); $this->assertEquals('localhost', $result->getCountry()->getName()); } @@ -75,12 +75,12 @@ public function testGeocodeWithRealIPv4(): void $provider = $this->getProvider(); $results = $provider->geocodeQuery(GeocodeQuery::create('74.200.247.59')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(37.751, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-97.822, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('United States', $result->getCountry()->getName()); @@ -92,12 +92,12 @@ public function testGeocodeWithRealIPv6(): void $provider = $this->getProvider(); $results = $provider->geocodeQuery(GeocodeQuery::create('::ffff:74.200.247.59')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(37.751, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-97.822, $result->getCoordinates()->getLongitude(), 0.01); @@ -110,12 +110,12 @@ public function testGeocodeWithUSIPv4(): void $provider = $this->getProvider(); $results = $provider->geocodeQuery(GeocodeQuery::create('72.229.28.185')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(40.7263, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-73.9819, $result->getCoordinates()->getLongitude(), 0.01); @@ -133,12 +133,12 @@ public function testGeocodeWithUSIPv6(): void $provider = $this->getProvider(); $results = $provider->geocodeQuery(GeocodeQuery::create('::ffff:74.200.247.59')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); @@ -149,7 +149,7 @@ public function testGeocodeWithUKIPv4(): void $provider = $this->getProvider(); $results = $provider->geocodeQuery(GeocodeQuery::create('129.67.242.154')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); $this->assertEquals('GB', $results->first()->getCountry()->getCode()); @@ -163,7 +163,7 @@ public function testGeocodeWithUKIPv6(): void $provider = $this->getProvider(); $results = $provider->geocodeQuery(GeocodeQuery::create('::ffff:129.67.242.154')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); $this->assertEquals('GB', $results->first()->getCountry()->getCode()); } @@ -173,7 +173,7 @@ public function testGeocodeWithRuLocale(): void $provider = $this->getProvider(); $results = $provider->geocodeQuery(GeocodeQuery::create('81.27.51.253')->withLocale('ru')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); $this->assertEquals('Владимирская область', $results->first()->getAdminLevels()->first()->getName()); $this->assertEquals('Владимир', $results->first()->getLocality()); @@ -185,7 +185,7 @@ public function testGeocodeWithFrLocale(): void $provider = $this->getProvider(); $results = $provider->geocodeQuery(GeocodeQuery::create('81.27.51.252')->withLocale('fr')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); $this->assertEquals('Oblast de Vladimir', $results->first()->getAdminLevels()->first()->getName()); $this->assertEquals('Vladimir', $results->first()->getLocality()); @@ -197,7 +197,7 @@ public function testGeocodeWithIncorrectLocale(): void $provider = $this->getProvider(); $results = $provider->geocodeQuery(GeocodeQuery::create('81.27.51.251')->withLocale('wrong_locale')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); $this->assertEquals('Vladimirskaya Oblast\'', $results->first()->getAdminLevels()->first()->getName()); $this->assertEquals('Vladimir', $results->first()->getLocality()); diff --git a/src/Provider/FreeGeoIp/composer.json b/src/Provider/FreeGeoIp/composer.json index 6b9c5ef9b..70d58d870 100644 --- a/src/Provider/FreeGeoIp/composer.json +++ b/src/Provider/FreeGeoIp/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.1", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/GeoIP2/CHANGELOG.md b/src/Provider/GeoIP2/CHANGELOG.md index f7a89bffe..e47e06e00 100644 --- a/src/Provider/GeoIP2/CHANGELOG.md +++ b/src/Provider/GeoIP2/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.4.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 4.3.0 ### Added diff --git a/src/Provider/GeoIP2/Tests/GeoIP2AdapterTest.php b/src/Provider/GeoIP2/Tests/GeoIP2AdapterTest.php index 1a3be5cac..d052ac89c 100644 --- a/src/Provider/GeoIP2/Tests/GeoIP2AdapterTest.php +++ b/src/Provider/GeoIP2/Tests/GeoIP2AdapterTest.php @@ -31,7 +31,7 @@ class GeoIP2AdapterTest extends TestCase */ public static function setUpBeforeClass(): void { - if (false === class_exists('\GeoIp2\Database\Reader')) { + if (false === class_exists(\GeoIp2\Database\Reader::class)) { throw new \RuntimeException("The maxmind's lib 'geoip2/geoip2' is required to run this test."); } } @@ -126,7 +126,7 @@ public function testReaderResponseIsJsonEncoded(): void */ protected function getGeoIP2ProviderMock() { - $mock = $this->getMockBuilder('\GeoIp2\ProviderInterface')->getMock(); + $mock = $this->getMockBuilder(\GeoIp2\ProviderInterface::class)->getMock(); return $mock; } diff --git a/src/Provider/GeoIP2/Tests/GeoIP2Test.php b/src/Provider/GeoIP2/Tests/GeoIP2Test.php index 3ce72e465..bc0885452 100644 --- a/src/Provider/GeoIP2/Tests/GeoIP2Test.php +++ b/src/Provider/GeoIP2/Tests/GeoIP2Test.php @@ -63,12 +63,12 @@ public function testGeocodeWithLocalhostIPv4(): void { $results = $this->provider->geocodeQuery(GeocodeQuery::create('127.0.0.1')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('localhost', $result->getLocality()); $this->assertEquals('localhost', $result->getCountry()->getName()); } @@ -172,12 +172,12 @@ public function testRetrievingGeodata(string $address, string $adapterResponse, $results = $provider->geocodeQuery(GeocodeQuery::create($address)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); if (isset($expectedGeodata['latitude'])) { $this->assertEquals($expectedGeodata['latitude'], $result->getCoordinates()->getLatitude()); $this->assertEquals($expectedGeodata['longitude'], $result->getCoordinates()->getLongitude()); diff --git a/src/Provider/GeoIP2/composer.json b/src/Provider/GeoIP2/composer.json index 2719b56b0..57770f775 100644 --- a/src/Provider/GeoIP2/composer.json +++ b/src/Provider/GeoIP2/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geoip2/geoip2": "^2.0|^3.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/GeoIPs/Tests/GeoIPsTest.php b/src/Provider/GeoIPs/Tests/GeoIPsTest.php index 6dfa13dfa..72136e56b 100644 --- a/src/Provider/GeoIPs/Tests/GeoIPsTest.php +++ b/src/Provider/GeoIPs/Tests/GeoIPsTest.php @@ -46,12 +46,12 @@ public function testGeocodeWithLocalhostIPv4(): void $provider = new GeoIPs($this->getMockedHttpClient(), 'api_key'); $results = $provider->geocodeQuery(GeocodeQuery::create('127.0.0.1')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('localhost', $result->getLocality()); $this->assertEquals('localhost', $result->getCountry()->getName()); } @@ -112,12 +112,12 @@ public function testGeocodeWithRealIPv4GetsFakeContentFormattedEmpty(): void $provider = new GeoIPs($this->getMockedHttpClient($json), 'api_key'); $results = $provider->geocodeQuery(GeocodeQuery::create('66.147.244.214')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertNull($result->getCoordinates()); $this->assertNull($result->getPostalCode()); @@ -154,12 +154,12 @@ public function testGeocodeWithRealIPv4GetsFakeContent(): void $provider = new GeoIPs($this->getMockedHttpClient($json), 'api_key'); $results = $provider->geocodeQuery(GeocodeQuery::create('66.147.244.214')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(40.3402, $result->getCoordinates()->getLatitude(), 0.0001); $this->assertEqualsWithDelta(-111.6073, $result->getCoordinates()->getLongitude(), 0.0001); $this->assertNull($result->getStreetName()); @@ -308,12 +308,12 @@ public function testGeocodeWithRealIPv4(): void $provider = new GeoIPs($this->getHttpClient($_SERVER['GEOIPS_API_KEY']), $_SERVER['GEOIPS_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('66.147.244.214')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(40.3402, $result->getCoordinates()->getLatitude(), 0.0001); $this->assertEqualsWithDelta(-111.6073, $result->getCoordinates()->getLongitude(), 0.0001); $this->assertNull($result->getStreetName()); diff --git a/src/Provider/GeoIPs/composer.json b/src/Provider/GeoIPs/composer.json index 7e9d802dc..7eac6dcb3 100644 --- a/src/Provider/GeoIPs/composer.json +++ b/src/Provider/GeoIPs/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.1" + "willdurand/geocoder": "^4.1|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/GeoPlugin/CHANGELOG.md b/src/Provider/GeoPlugin/CHANGELOG.md index 69935445f..a47612315 100644 --- a/src/Provider/GeoPlugin/CHANGELOG.md +++ b/src/Provider/GeoPlugin/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.4.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 4.3.0 ### Added diff --git a/src/Provider/GeoPlugin/Tests/GeoPluginTest.php b/src/Provider/GeoPlugin/Tests/GeoPluginTest.php index 36c151e1f..3cbb39aff 100644 --- a/src/Provider/GeoPlugin/Tests/GeoPluginTest.php +++ b/src/Provider/GeoPlugin/Tests/GeoPluginTest.php @@ -44,7 +44,7 @@ public function testGeocodeWithLocalhostIPv4(): void $provider = new GeoPlugin($this->getMockedHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('127.0.0.1')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); $result = $results->first(); @@ -57,7 +57,7 @@ public function testGeocodeWithLocalhostIPv6(): void $provider = new GeoPlugin($this->getMockedHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('::1')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); $result = $results->first(); @@ -70,7 +70,7 @@ public function testGeocodeWithRealIPv4(): void $provider = new GeoPlugin($this->getHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('66.147.244.214')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); $result = $results->first(); diff --git a/src/Provider/GeoPlugin/composer.json b/src/Provider/GeoPlugin/composer.json index 896557c35..64af30cd1 100644 --- a/src/Provider/GeoPlugin/composer.json +++ b/src/Provider/GeoPlugin/composer.json @@ -15,7 +15,7 @@ "php": "^8.0", "geocoder-php/common-http": "^4.0", "igorw/get-in": "^1.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/GeocodeEarth/CHANGELOG.md b/src/Provider/GeocodeEarth/CHANGELOG.md index bf55e9c58..5ea31c8bb 100644 --- a/src/Provider/GeocodeEarth/CHANGELOG.md +++ b/src/Provider/GeocodeEarth/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 1.5.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 1.4.0 ### Added diff --git a/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_018106242c4d680866920804be3bb5c08aa56367 b/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_018106242c4d680866920804be3bb5c08aa56367 index 0e570740a..f7a51510f 100644 --- a/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_018106242c4d680866920804be3bb5c08aa56367 +++ b/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_018106242c4d680866920804be3bb5c08aa56367 @@ -1 +1 @@ -s:4642:"{"geocoding":{"version":"0.2","attribution":"https://geocode.earth/guidelines","query":{"size":5,"private":false,"point.lat":54.0484068,"point.lon":-2.7990345,"boundary.circle.lat":54.0484068,"boundary.circle.lon":-2.7990345,"lang":{"name":"English","iso6391":"en","iso6393":"eng","defaulted":true},"querySize":10},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1569514974986},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.798964,54.04843]},"properties":{"id":"way/568787583","gid":"openstreetmap:venue:way/568787583","layer":"venue","source":"openstreetmap","source_id":"way/568787583","name":"Collegian W.M.C","housenumber":"1","street":"Gage Street","postalcode":"LA1 1UH","confidence":0.9,"distance":0.005,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:85683853","region_a":"LAN","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Collegian W.M.C, Lancaster, England, United Kingdom"},"bbox":[-2.7991111,54.0483534,-2.798818,54.0485068]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.798964,54.04843]},"properties":{"id":"way/568787583","gid":"openstreetmap:address:way/568787583","layer":"address","source":"openstreetmap","source_id":"way/568787583","name":"1 Gage Street","housenumber":"1","street":"Gage Street","postalcode":"LA1 1UH","confidence":0.9,"distance":0.005,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:85683853","region_a":"LAN","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"1 Gage Street, Lancaster, England, United Kingdom"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.79913,54.048378]},"properties":{"id":"node/3930587961","gid":"openstreetmap:venue:node/3930587961","layer":"venue","source":"openstreetmap","source_id":"node/3930587961","name":"Stable End Curio's","confidence":0.9,"distance":0.007,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:85683853","region_a":"LAN","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Stable End Curio's, Lancaster, England, United Kingdom"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.79931,54.048391]},"properties":{"id":"node/6592154385","gid":"openstreetmap:venue:node/6592154385","layer":"venue","source":"openstreetmap","source_id":"node/6592154385","name":"Diggles","housenumber":"5-7","street":"Ffrances Passage","postalcode":"LA1 1UG","confidence":0.8,"distance":0.018,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:85683853","region_a":"LAN","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Diggles, Lancaster, England, United Kingdom"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.79931,54.048391]},"properties":{"id":"node/6592154385","gid":"openstreetmap:address:node/6592154385","layer":"address","source":"openstreetmap","source_id":"node/6592154385","name":"5-7 Ffrances Passage","housenumber":"5-7","street":"Ffrances Passage","postalcode":"LA1 1UG","confidence":0.8,"distance":0.018,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:85683853","region_a":"LAN","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"5-7 Ffrances Passage, Lancaster, England, United Kingdom"}}],"bbox":[-2.79931,54.0483534,-2.798818,54.0485068]}"; \ No newline at end of file +s:6006:"{"geocoding":{"version":"0.2","attribution":"https://geocode.earth/guidelines","query":{"size":5,"private":false,"point.lat":54.0484068,"point.lon":-2.7990345,"boundary.circle.lat":54.0484068,"boundary.circle.lon":-2.7990345,"lang":{"name":"English","iso6391":"en","iso6393":"eng","via":"default","defaulted":true},"querySize":10},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1742398402238},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.79913,54.048378]},"properties":{"id":"node/3930587961","gid":"openstreetmap:address:node/3930587961","layer":"address","source":"openstreetmap","source_id":"node/3930587961","country_code":"GB","name":"11 Ffrances Passage","housenumber":"11","street":"Ffrances Passage","postalcode":"LA1 1UG","confidence":0.9,"distance":0.007,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:1880762711","region_a":"LAN","macrocounty":"Lancashire","macrocounty_gid":"whosonfirst:macrocounty:1880762053","county":"Lancaster","county_gid":"whosonfirst:county:1880771531","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"11 Ffrances Passage, Lancaster, England, United Kingdom","addendum":{"osm":{"website":"https://stableendcurios.co.uk/","opening_hours":"Mo-Fr 10:00-16:30; Sa 09:30-16:30"}}}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.79913,54.048378]},"properties":{"id":"node/3930587961","gid":"openstreetmap:venue:node/3930587961","layer":"venue","source":"openstreetmap","source_id":"node/3930587961","country_code":"GB","name":"Stable End Curios","housenumber":"11","street":"Ffrances Passage","postalcode":"LA1 1UG","confidence":0.9,"distance":0.007,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:1880762711","region_a":"LAN","macrocounty":"Lancashire","macrocounty_gid":"whosonfirst:macrocounty:1880762053","county":"Lancaster","county_gid":"whosonfirst:county:1880771531","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Stable End Curios, Lancaster, England, United Kingdom","addendum":{"osm":{"website":"https://stableendcurios.co.uk/","opening_hours":"Mo-Fr 10:00-16:30; Sa 09:30-16:30"}}}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.798864,54.048381]},"properties":{"id":"way/568787583","gid":"openstreetmap:venue:way/568787583","layer":"venue","source":"openstreetmap","source_id":"way/568787583","country_code":"GB","name":"Collegian W.M.C","housenumber":"1","street":"Gage Street","postalcode":"LA1 1UH","confidence":0.8,"distance":0.012,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:1880762711","region_a":"LAN","macrocounty":"Lancashire","macrocounty_gid":"whosonfirst:macrocounty:1880762053","county":"Lancaster","county_gid":"whosonfirst:county:1880771531","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Collegian W.M.C, Lancaster, England, United Kingdom"},"bbox":[-2.7991032,54.0483796,-2.7988259,54.0484971]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.798864,54.048381]},"properties":{"id":"way/568787583","gid":"openstreetmap:address:way/568787583","layer":"address","source":"openstreetmap","source_id":"way/568787583","country_code":"GB","name":"1 Gage Street","housenumber":"1","street":"Gage Street","postalcode":"LA1 1UH","confidence":0.8,"distance":0.012,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:1880762711","region_a":"LAN","macrocounty":"Lancashire","macrocounty_gid":"whosonfirst:macrocounty:1880762053","county":"Lancaster","county_gid":"whosonfirst:county:1880771531","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"1 Gage Street, Lancaster, England, United Kingdom"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.799226,54.048388]},"properties":{"id":"node/7972660790","gid":"openstreetmap:venue:node/7972660790","layer":"venue","source":"openstreetmap","source_id":"node/7972660790","country_code":"GB","name":"Evolve Tattoos","housenumber":"9","street":"Ffrances Passage","postalcode":"LA1 1UG","confidence":0.8,"distance":0.013,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:1880762711","region_a":"LAN","macrocounty":"Lancashire","macrocounty_gid":"whosonfirst:macrocounty:1880762053","county":"Lancaster","county_gid":"whosonfirst:county:1880771531","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Evolve Tattoos, Lancaster, England, United Kingdom","addendum":{"osm":{"website":"https://www.facebook.com/pages/category/Tattoo---Piercing-Shop/Evolve-Tattoo-and-Body-Arts-Studio-123157141032019/","opening_hours":"Tu-Sa 10:00-17:00"}}}}],"bbox":[-2.799226,54.048378,-2.7988259,54.0484971]}"; \ No newline at end of file diff --git a/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_0b8ece4d157e378d8af559e36033bb8fcb6fc86a b/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_0b8ece4d157e378d8af559e36033bb8fcb6fc86a index b00242fc2..3cd2797f2 100644 --- a/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_0b8ece4d157e378d8af559e36033bb8fcb6fc86a +++ b/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_0b8ece4d157e378d8af559e36033bb8fcb6fc86a @@ -1 +1 @@ -s:6384:"{"geocoding":{"version":"0.2","attribution":"https://geocode.earth/guidelines","query":{"size":5,"private":false,"point.lat":49.1390924,"point.lon":1.6572462,"boundary.circle.lat":49.1390924,"boundary.circle.lon":1.6572462,"lang":{"name":"English","iso6391":"en","iso6393":"eng","defaulted":true},"querySize":10},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1569514975455},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[1.657246,49.139092]},"properties":{"id":"node/1564292039","gid":"openstreetmap:venue:node/1564292039","layer":"venue","source":"openstreetmap","source_id":"node/1564292039","name":"Les Jardins d'Épicure","confidence":1,"distance":0,"accuracy":"point","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"arrondissement of Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-en-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Les Jardins d'Épicure, Bray-et-Lû, France"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[1.657114,49.13946]},"properties":{"id":"fr/val_doise:70360ba1564d68eb","gid":"openaddresses:address:fr/val_doise:70360ba1564d68eb","layer":"address","source":"openaddresses","source_id":"fr/val_doise:70360ba1564d68eb","name":"16 Grande Rue","housenumber":"16","street":"Grande Rue","confidence":0.8,"distance":0.042,"accuracy":"point","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"arrondissement of Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-en-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"16 Grande Rue, Bray-et-Lû, France"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[1.658166,49.139008]},"properties":{"id":"fr/val_doise:a1d4989dfd60274d","gid":"openaddresses:address:fr/val_doise:a1d4989dfd60274d","layer":"address","source":"openaddresses","source_id":"fr/val_doise:a1d4989dfd60274d","name":"2 Rue Des Pres","housenumber":"2","street":"Rue Des Pres","confidence":0.8,"distance":0.068,"accuracy":"point","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"arrondissement of Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-en-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"2 Rue Des Pres, Bray-et-Lû, France"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[1.658165,49.139241]},"properties":{"id":"fr/val_doise:ff284c2f4f90a313","gid":"openaddresses:address:fr/val_doise:ff284c2f4f90a313","layer":"address","source":"openaddresses","source_id":"fr/val_doise:ff284c2f4f90a313","name":"3 Rue Des Pres","housenumber":"3","street":"Rue Des Pres","confidence":0.8,"distance":0.069,"accuracy":"point","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"arrondissement of Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-en-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"3 Rue Des Pres, Bray-et-Lû, France"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[1.657443,49.1397]},"properties":{"id":"fr/val_doise:e0ab41d7033ce285","gid":"openaddresses:address:fr/val_doise:e0ab41d7033ce285","layer":"address","source":"openaddresses","source_id":"fr/val_doise:e0ab41d7033ce285","name":"23 Grande Rue","housenumber":"23","street":"Grande Rue","confidence":0.8,"distance":0.069,"accuracy":"point","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"arrondissement of Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-en-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"23 Grande Rue, Bray-et-Lû, France"}}],"bbox":[1.657114,49.139008,1.658166,49.1397]}"; \ No newline at end of file +s:6482:"{"geocoding":{"version":"0.2","attribution":"https://geocode.earth/guidelines","query":{"size":5,"private":false,"point.lat":49.1390924,"point.lon":1.6572462,"boundary.circle.lat":49.1390924,"boundary.circle.lon":1.6572462,"lang":{"name":"English","iso6391":"en","iso6393":"eng","via":"default","defaulted":true},"querySize":10},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1742398402708},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[1.657246,49.139092]},"properties":{"id":"node/1564292039","gid":"openstreetmap:venue:node/1564292039","layer":"venue","source":"openstreetmap","source_id":"node/1564292039","country_code":"FR","name":"Les Jardins d'Épicure","confidence":1,"distance":0,"accuracy":"point","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-En-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Les Jardins d'Épicure, Bray-et-Lû, France"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[1.657114,49.13946]},"properties":{"id":"fr/countrywide:7668c8bb1f0a9b51","gid":"openaddresses:address:fr/countrywide:7668c8bb1f0a9b51","layer":"address","source":"openaddresses","source_id":"fr/countrywide:7668c8bb1f0a9b51","country_code":"FR","name":"16 Grande Rue","housenumber":"16","street":"Grande Rue","postalcode":"95710","confidence":0.8,"distance":0.042,"accuracy":"point","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-En-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"16 Grande Rue, Bray-et-Lû, France"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[1.657021,49.139493]},"properties":{"id":"polyline:28832445","gid":"openstreetmap:street:polyline:28832445","layer":"street","source":"openstreetmap","source_id":"polyline:28832445","country_code":"FR","name":"Grande Rue","street":"Grande Rue","confidence":0.8,"distance":0.048,"accuracy":"centroid","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-En-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Grande Rue, Bray-et-Lû, France"},"bbox":[1.653428,49.138891,1.658696,49.139839]},{"type":"Feature","geometry":{"type":"Point","coordinates":[1.658166,49.139008]},"properties":{"id":"fr/countrywide:9e578e75e327e5f8","gid":"openaddresses:address:fr/countrywide:9e578e75e327e5f8","layer":"address","source":"openaddresses","source_id":"fr/countrywide:9e578e75e327e5f8","country_code":"FR","name":"2 Rue Des Pres","housenumber":"2","street":"Rue Des Pres","postalcode":"95710","confidence":0.8,"distance":0.068,"accuracy":"point","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-En-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"2 Rue Des Pres, Bray-et-Lû, France"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[1.658165,49.139241]},"properties":{"id":"fr/countrywide:afc1fe137b14c9cc","gid":"openaddresses:address:fr/countrywide:afc1fe137b14c9cc","layer":"address","source":"openaddresses","source_id":"fr/countrywide:afc1fe137b14c9cc","country_code":"FR","name":"3 Rue Des Pres","housenumber":"3","street":"Rue Des Pres","postalcode":"95710","confidence":0.8,"distance":0.069,"accuracy":"point","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-En-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"3 Rue Des Pres, Bray-et-Lû, France"}}],"bbox":[1.653428,49.138891,1.658696,49.139839]}"; \ No newline at end of file diff --git a/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_45b951d64cd3be74e372c32a1a67947d39fe5531 b/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_45b951d64cd3be74e372c32a1a67947d39fe5531 index 602b10c68..9daf23f33 100644 --- a/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_45b951d64cd3be74e372c32a1a67947d39fe5531 +++ b/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_45b951d64cd3be74e372c32a1a67947d39fe5531 @@ -1 +1 @@ -s:4621:"{"geocoding":{"version":"0.2","attribution":"https://geocode.earth/guidelines","query":{"size":5,"private":false,"point.lat":38.900206,"point.lon":-77.036991,"boundary.circle.lat":38.900206,"boundary.circle.lon":-77.036991,"lang":{"name":"English","iso6391":"en","iso6393":"eng","defaulted":true},"querySize":10},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1569514977913},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.0367,38.9003]},"properties":{"id":"6482379","gid":"geonames:venue:6482379","layer":"venue","source":"geonames","source_id":"6482379","name":"The Hay Adams across from the White House","confidence":0.8,"distance":0.027,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Downtown","neighbourhood_gid":"whosonfirst:neighbourhood:85866033","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"The Hay Adams across from the White House, Washington, DC, USA"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.0372,38.90039]},"properties":{"id":"4140517","gid":"geonames:venue:4140517","layer":"venue","source":"geonames","source_id":"4140517","name":"Slidell House (historical)","confidence":0.8,"distance":0.027,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Downtown","neighbourhood_gid":"whosonfirst:neighbourhood:85866033","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Slidell House (historical), Washington, DC, USA"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.03664,38.90011]},"properties":{"id":"4137678","gid":"geonames:venue:4137678","layer":"venue","source":"geonames","source_id":"4137678","name":"Bancroft House (historical)","confidence":0.8,"distance":0.032,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Lafayette Square","neighbourhood_gid":"whosonfirst:neighbourhood:1108724047","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Bancroft House (historical), Washington, DC, USA"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.036971,38.900514]},"properties":{"id":"us/dc/statewide:ce1de04bc53e9b0d","gid":"openaddresses:address:us/dc/statewide:ce1de04bc53e9b0d","layer":"address","source":"openaddresses","source_id":"us/dc/statewide:ce1de04bc53e9b0d","name":"800 16th Street NW","housenumber":"800","street":"16th Street NW","postalcode":"20006","confidence":0.8,"distance":0.034,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Downtown","neighbourhood_gid":"whosonfirst:neighbourhood:85866033","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"800 16th Street NW, Washington, DC, USA"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.036952,38.900522]},"properties":{"id":"way/55326891","gid":"openstreetmap:address:way/55326891","layer":"address","source":"openstreetmap","source_id":"way/55326891","name":"800 16th Street Northwest","housenumber":"800","street":"16th Street Northwest","postalcode":"20006","confidence":0.8,"distance":0.035,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Downtown","neighbourhood_gid":"whosonfirst:neighbourhood:85866033","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"800 16th Street Northwest, Washington, DC, USA","addendum":{"osm":{"wikidata":"Q11861763"}}}}],"bbox":[-77.0372,38.90011,-77.03664,38.900522]}"; \ No newline at end of file +s:5434:"{"geocoding":{"version":"0.2","attribution":"https://geocode.earth/guidelines","query":{"size":5,"private":false,"point.lat":38.900206,"point.lon":-77.036991,"boundary.circle.lat":38.900206,"boundary.circle.lon":-77.036991,"lang":{"name":"English","iso6391":"en","iso6393":"eng","via":"default","defaulted":true},"querySize":10},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1742398405497},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.0367,38.9003]},"properties":{"id":"6482379","gid":"geonames:venue:6482379","layer":"venue","source":"geonames","source_id":"6482379","country_code":"US","name":"The Hay Adams across from the White House","confidence":0.8,"distance":0.027,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","county":"District of Columbia","county_gid":"whosonfirst:county:1377370667","county_a":"DI","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Downtown","neighbourhood_gid":"whosonfirst:neighbourhood:85866033","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"The Hay Adams across from the White House, Washington, DC, USA","addendum":{"geonames":{"feature_code":"HTL"}}}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.0372,38.90039]},"properties":{"id":"4140517","gid":"geonames:venue:4140517","layer":"venue","source":"geonames","source_id":"4140517","country_code":"US","name":"Slidell House (historical)","confidence":0.8,"distance":0.027,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","county":"District of Columbia","county_gid":"whosonfirst:county:1377370667","county_a":"DI","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Downtown","neighbourhood_gid":"whosonfirst:neighbourhood:85866033","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Slidell House (historical), Washington, DC, USA","addendum":{"geonames":{"feature_code":"BLDG"}}}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.03664,38.90011]},"properties":{"id":"4137678","gid":"geonames:venue:4137678","layer":"venue","source":"geonames","source_id":"4137678","country_code":"US","name":"Bancroft House (historical)","confidence":0.8,"distance":0.032,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","county":"District of Columbia","county_gid":"whosonfirst:county:1377370667","county_a":"DI","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Lafayette Square","neighbourhood_gid":"whosonfirst:neighbourhood:1108724047","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Bancroft House (historical), Washington, DC, USA","addendum":{"geonames":{"feature_code":"BLDG"}}}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.036971,38.900514]},"properties":{"id":"us/dc/statewide:cbf8d4cab454772f","gid":"openaddresses:address:us/dc/statewide:cbf8d4cab454772f","layer":"address","source":"openaddresses","source_id":"us/dc/statewide:cbf8d4cab454772f","country_code":"US","name":"800 16th Street NW","housenumber":"800","street":"16th Street NW","postalcode":"20006","confidence":0.8,"distance":0.034,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","county":"District of Columbia","county_gid":"whosonfirst:county:1377370667","county_a":"DI","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Downtown","neighbourhood_gid":"whosonfirst:neighbourhood:85866033","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"800 16th Street NW, Washington, DC, USA"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.036945,38.900522]},"properties":{"id":"way/55326891","gid":"openstreetmap:venue:way/55326891","layer":"venue","source":"openstreetmap","source_id":"way/55326891","country_code":"US","name":"Hay-Adams Hotel","housenumber":"800","street":"16th Street NW","postalcode":"20006","confidence":0.8,"distance":0.035,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","county":"District of Columbia","county_gid":"whosonfirst:county:1377370667","county_a":"DI","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Downtown","neighbourhood_gid":"whosonfirst:neighbourhood:85866033","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Hay-Adams Hotel, Washington, DC, USA","addendum":{"osm":{"wikidata":"Q11861763","website":"https://www.hayadams.com/","phone":"+1 202-638-6600"}}},"bbox":[-77.0371738,38.9003173,-77.0367231,38.9006934]}],"bbox":[-77.0372,38.90011,-77.03664,38.9006934]}"; \ No newline at end of file diff --git a/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_56050541936504e8053da078cdf95f989927f5ce b/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_56050541936504e8053da078cdf95f989927f5ce index 3d46dd4fa..f3609a526 100644 --- a/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_56050541936504e8053da078cdf95f989927f5ce +++ b/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_56050541936504e8053da078cdf95f989927f5ce @@ -1 +1 @@ -s:1504:"{"geocoding":{"version":"0.2","attribution":"https://geocode.earth/guidelines","query":{"text":"242 Acklam Road, London, United Kingdom","size":5,"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","defaulted":true},"querySize":20,"parser":"libpostal","parsed_text":{"number":"242","street":"acklam road","city":"london","country":"united kingdom"}},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1569514974510},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-0.2028,51.521334]},"properties":{"id":"way/526221246","gid":"openstreetmap:address:way/526221246","layer":"address","source":"openstreetmap","source_id":"way/526221246","name":"242 Acklam Road","housenumber":"242","street":"Acklam Road","postalcode":"W10 5JJ","confidence":1,"match_type":"exact","accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","locality":"London","locality_gid":"whosonfirst:locality:101750367","borough":"Kensington and Chelsea","borough_gid":"whosonfirst:borough:1158857317","neighbourhood":"North Kensington","neighbourhood_gid":"whosonfirst:neighbourhood:85789461","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"242 Acklam Road, London, England, United Kingdom","addendum":{"osm":{"wikidata":"Q7987154"}}}}],"bbox":[-0.2028,51.521334,-0.2028,51.521334]}"; \ No newline at end of file +s:1878:"{"geocoding":{"version":"0.2","attribution":"https://geocode.earth/guidelines","query":{"text":"242 Acklam Road, London, United Kingdom","size":5,"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","via":"default","defaulted":true},"querySize":20,"parser":"libpostal","parsed_text":{"housenumber":"242","street":"acklam road","city":"london","country":"united kingdom"}},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1742398401836},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-0.202887,51.521315]},"properties":{"id":"way/526221246","gid":"openstreetmap:address:way/526221246","layer":"address","source":"openstreetmap","source_id":"way/526221246","country_code":"GB","name":"242 Acklam Road","housenumber":"242","street":"Acklam Road","postalcode":"W10 5JJ","confidence":1,"match_type":"exact","accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Greater London","region_gid":"whosonfirst:region:1880762729","macrocounty":"Greater London","macrocounty_gid":"whosonfirst:macrocounty:1880762179","county":"Lambeth","county_gid":"whosonfirst:county:1880771825","locality":"London","locality_gid":"whosonfirst:locality:101750367","borough":"Kensington and Chelsea","borough_gid":"whosonfirst:borough:1158857317","neighbourhood":"North Kensington","neighbourhood_gid":"whosonfirst:neighbourhood:85789461","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"242 Acklam Road, London, England, United Kingdom","addendum":{"osm":{"wikidata":"Q7987154","wikipedia":"en:Westbourne Studios","website":"https://www.workspace.co.uk/workspaces/westbourne-studios"}}}}],"bbox":[-0.202887,51.521315,-0.202887,51.521315]}"; \ No newline at end of file diff --git a/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_8e9430395c40012ffd2256c8b42c0b8beabf6706 b/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_8e9430395c40012ffd2256c8b42c0b8beabf6706 index 58638758b..497f74369 100644 --- a/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_8e9430395c40012ffd2256c8b42c0b8beabf6706 +++ b/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_8e9430395c40012ffd2256c8b42c0b8beabf6706 @@ -1 +1 @@ -s:759:"{"geocoding":{"version":"0.2","attribution":"https://geocode.earth/guidelines","query":{"text":"jsajhgsdkfjhsfkjhaldkadjaslgldasd","size":5,"layers":["venue","street","country","macroregion","region","county","localadmin","locality","borough","neighbourhood","continent","empire","dependency","macrocounty","macrohood","microhood","disputed","postalcode","ocean","marinearea"],"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","defaulted":true},"querySize":20,"parser":"pelias","parsed_text":{"subject":"jsajhgsdkfjhsfkjhaldkadjaslgldasd"}},"warnings":["performance optimization: excluding 'address' layer"],"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1569514977446},"type":"FeatureCollection","features":[]}"; \ No newline at end of file +s:778:"{"geocoding":{"version":"0.2","attribution":"https://geocode.earth/guidelines","query":{"text":"jsajhgsdkfjhsfkjhaldkadjaslgldasd","size":5,"layers":["venue","street","intersection","postalcode","locality","neighbourhood","county","localadmin","region","macrocounty","country","macroregion","dependency","borough","macrohood","marinearea","disputed","empire","continent","ocean"],"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","via":"default","defaulted":true},"querySize":20,"parser":"pelias","parsed_text":{"subject":"jsajhgsdkfjhsfkjhaldkadjaslgldasd"}},"warnings":["performance optimization: excluding 'address' layer"],"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1742398405086},"type":"FeatureCollection","features":[]}"; \ No newline at end of file diff --git a/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_bcf5bd9fe5f5350148dbed04ef8fc7d93b192179 b/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_bcf5bd9fe5f5350148dbed04ef8fc7d93b192179 index fdf9514bf..ffc329a9c 100644 --- a/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_bcf5bd9fe5f5350148dbed04ef8fc7d93b192179 +++ b/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_bcf5bd9fe5f5350148dbed04ef8fc7d93b192179 @@ -1 +1 @@ -s:5675:"{"geocoding":{"version":"0.2","attribution":"https://geocode.earth/guidelines","query":{"text":"dworzec centralny","size":5,"layers":["venue","street","country","macroregion","region","county","localadmin","locality","borough","neighbourhood","continent","empire","dependency","macrocounty","macrohood","microhood","disputed","postalcode","ocean","marinearea"],"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","defaulted":true},"querySize":20,"parser":"pelias","parsed_text":{"subject":"dworzec centralny"}},"warnings":["performance optimization: excluding 'address' layer"],"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1587573572737},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[21.002758,52.229253]},"properties":{"id":"node/341341208","gid":"openstreetmap:venue:node/341341208","layer":"venue","source":"openstreetmap","source_id":"node/341341208","name":"Dworzec Centralny 23","confidence":1,"match_type":"exact","accuracy":"point","country":"Poland","country_gid":"whosonfirst:country:85633723","country_a":"POL","region":"Mazowieckie","region_gid":"whosonfirst:region:85687257","region_a":"MZ","county":"Warszawa","county_gid":"whosonfirst:county:1477743805","localadmin":"Warsaw","localadmin_gid":"whosonfirst:localadmin:1125365875","locality":"Warsaw","locality_gid":"whosonfirst:locality:101752777","borough":"Śródmieście","borough_gid":"whosonfirst:borough:1477921687","neighbourhood":"Śródmieście","neighbourhood_gid":"whosonfirst:neighbourhood:85898119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Dworzec Centralny 23, Warsaw, Poland"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[21.005287,52.229541]},"properties":{"id":"node/334557966","gid":"openstreetmap:venue:node/334557966","layer":"venue","source":"openstreetmap","source_id":"node/334557966","name":"Dworzec Centralny 16","confidence":1,"match_type":"exact","accuracy":"point","country":"Poland","country_gid":"whosonfirst:country:85633723","country_a":"POL","region":"Mazowieckie","region_gid":"whosonfirst:region:85687257","region_a":"MZ","county":"Warszawa","county_gid":"whosonfirst:county:1477743805","localadmin":"Warsaw","localadmin_gid":"whosonfirst:localadmin:1125365875","locality":"Warsaw","locality_gid":"whosonfirst:locality:101752777","borough":"Śródmieście","borough_gid":"whosonfirst:borough:1477921687","neighbourhood":"Śródmieście","neighbourhood_gid":"whosonfirst:neighbourhood:85898119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Dworzec Centralny 16, Warsaw, Poland"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[21.004452,52.230099]},"properties":{"id":"node/334559445","gid":"openstreetmap:venue:node/334559445","layer":"venue","source":"openstreetmap","source_id":"node/334559445","name":"Dworzec Centralny 11","confidence":1,"match_type":"exact","accuracy":"point","country":"Poland","country_gid":"whosonfirst:country:85633723","country_a":"POL","region":"Mazowieckie","region_gid":"whosonfirst:region:85687257","region_a":"MZ","county":"Warszawa","county_gid":"whosonfirst:county:1477743805","localadmin":"Warsaw","localadmin_gid":"whosonfirst:localadmin:1125365875","locality":"Warsaw","locality_gid":"whosonfirst:locality:101752777","borough":"Śródmieście","borough_gid":"whosonfirst:borough:1477921687","neighbourhood":"Śródmieście","neighbourhood_gid":"whosonfirst:neighbourhood:85898119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Dworzec Centralny 11, Warsaw, Poland"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[21.003501,52.227901]},"properties":{"id":"node/334558526","gid":"openstreetmap:venue:node/334558526","layer":"venue","source":"openstreetmap","source_id":"node/334558526","name":"Dworzec Centralny 01","confidence":1,"match_type":"exact","accuracy":"point","country":"Poland","country_gid":"whosonfirst:country:85633723","country_a":"POL","region":"Mazowieckie","region_gid":"whosonfirst:region:85687257","region_a":"MZ","county":"Warszawa","county_gid":"whosonfirst:county:1477743805","localadmin":"Warsaw","localadmin_gid":"whosonfirst:localadmin:1125365875","locality":"Warsaw","locality_gid":"whosonfirst:locality:101752777","borough":"Śródmieście","borough_gid":"whosonfirst:borough:1477921687","neighbourhood":"Śródmieście","neighbourhood_gid":"whosonfirst:neighbourhood:85898119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Dworzec Centralny 01, Warsaw, Poland"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[21.000745,52.22887]},"properties":{"id":"way/285280427","gid":"openstreetmap:venue:way/285280427","layer":"venue","source":"openstreetmap","source_id":"way/285280427","name":"Dworzec Centralny 03","confidence":1,"match_type":"exact","accuracy":"point","country":"Poland","country_gid":"whosonfirst:country:85633723","country_a":"POL","region":"Mazowieckie","region_gid":"whosonfirst:region:85687257","region_a":"MZ","county":"Warszawa","county_gid":"whosonfirst:county:1477743805","localadmin":"Warsaw","localadmin_gid":"whosonfirst:localadmin:1125365875","locality":"Warsaw","locality_gid":"whosonfirst:locality:101752777","borough":"Wola","borough_gid":"whosonfirst:borough:1477921679","neighbourhood":"Śródmieście","neighbourhood_gid":"whosonfirst:neighbourhood:85898119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Dworzec Centralny 03, Warsaw, Poland"},"bbox":[21.0006503,52.2287427,21.0008859,52.2290291]}],"bbox":[21.0006503,52.227901,21.005287,52.230099]}"; \ No newline at end of file +s:6046:"{"geocoding":{"version":"0.2","attribution":"https://geocode.earth/guidelines","query":{"text":"dworzec centralny","size":5,"layers":["venue","street","intersection","postalcode","locality","neighbourhood","county","localadmin","region","macrocounty","country","macroregion","dependency","borough","macrohood","marinearea","disputed","empire","continent","ocean"],"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","via":"default","defaulted":true},"querySize":20,"parser":"pelias","parsed_text":{"subject":"dworzec centralny"}},"warnings":["performance optimization: excluding 'address' layer"],"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1742398404207},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[21.004029,52.22888]},"properties":{"id":"node/12091857349","gid":"openstreetmap:venue:node/12091857349","layer":"venue","source":"openstreetmap","source_id":"node/12091857349","country_code":"PL","name":"Dworzec Centralny","confidence":1,"match_type":"exact","accuracy":"point","country":"Poland","country_gid":"whosonfirst:country:85633723","country_a":"POL","region":"Mazowieckie","region_gid":"whosonfirst:region:85687257","region_a":"MZ","county":"Warszawa","county_gid":"whosonfirst:county:1477743805","localadmin":"Warsaw","localadmin_gid":"whosonfirst:localadmin:1125365875","locality":"Warsaw","locality_gid":"whosonfirst:locality:101752777","borough":"Śródmieście","borough_gid":"whosonfirst:borough:1477921687","neighbourhood":"Śródmieście","neighbourhood_gid":"whosonfirst:neighbourhood:85898119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Dworzec Centralny, Warsaw, MZ, Poland"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[21.001788,52.22858]},"properties":{"id":"node/12041898147","gid":"openstreetmap:venue:node/12041898147","layer":"venue","source":"openstreetmap","source_id":"node/12041898147","country_code":"PL","name":"Dworzec Centralny 79","confidence":1,"match_type":"exact","accuracy":"point","country":"Poland","country_gid":"whosonfirst:country:85633723","country_a":"POL","region":"Mazowieckie","region_gid":"whosonfirst:region:85687257","region_a":"MZ","county":"Warszawa","county_gid":"whosonfirst:county:1477743805","localadmin":"Warsaw","localadmin_gid":"whosonfirst:localadmin:1125365875","locality":"Warsaw","locality_gid":"whosonfirst:locality:101752777","borough":"Śródmieście","borough_gid":"whosonfirst:borough:1477921687","neighbourhood":"Śródmieście","neighbourhood_gid":"whosonfirst:neighbourhood:85898119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Dworzec Centralny 79, Warsaw, MZ, Poland","addendum":{"osm":{"wheelchair":"no"}}}},{"type":"Feature","geometry":{"type":"Point","coordinates":[21.001471,52.228204]},"properties":{"id":"node/10711780641","gid":"openstreetmap:venue:node/10711780641","layer":"venue","source":"openstreetmap","source_id":"node/10711780641","country_code":"PL","name":"Dworzec Centralny 09","confidence":1,"match_type":"exact","accuracy":"point","country":"Poland","country_gid":"whosonfirst:country:85633723","country_a":"POL","region":"Mazowieckie","region_gid":"whosonfirst:region:85687257","region_a":"MZ","county":"Warszawa","county_gid":"whosonfirst:county:1477743805","localadmin":"Warsaw","localadmin_gid":"whosonfirst:localadmin:1125365875","locality":"Warsaw","locality_gid":"whosonfirst:locality:101752777","borough":"Wola","borough_gid":"whosonfirst:borough:1477921679","neighbourhood":"Śródmieście","neighbourhood_gid":"whosonfirst:neighbourhood:85898119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Dworzec Centralny 09, Warsaw, MZ, Poland","addendum":{"osm":{"wheelchair":"yes","operator":"Tramwaje Warszawskie"}}}},{"type":"Feature","geometry":{"type":"Point","coordinates":[21.003063,52.228044]},"properties":{"id":"node/10693055387","gid":"openstreetmap:venue:node/10693055387","layer":"venue","source":"openstreetmap","source_id":"node/10693055387","country_code":"PL","name":"Dworzec Centralny 08","confidence":1,"match_type":"exact","accuracy":"point","country":"Poland","country_gid":"whosonfirst:country:85633723","country_a":"POL","region":"Mazowieckie","region_gid":"whosonfirst:region:85687257","region_a":"MZ","county":"Warszawa","county_gid":"whosonfirst:county:1477743805","localadmin":"Warsaw","localadmin_gid":"whosonfirst:localadmin:1125365875","locality":"Warsaw","locality_gid":"whosonfirst:locality:101752777","borough":"Śródmieście","borough_gid":"whosonfirst:borough:1477921687","neighbourhood":"Śródmieście","neighbourhood_gid":"whosonfirst:neighbourhood:85898119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Dworzec Centralny 08, Warsaw, MZ, Poland","addendum":{"osm":{"wheelchair":"yes","operator":"Tramwaje Warszawskie"}}}},{"type":"Feature","geometry":{"type":"Point","coordinates":[21.001467,52.228696]},"properties":{"id":"node/10711780640","gid":"openstreetmap:venue:node/10711780640","layer":"venue","source":"openstreetmap","source_id":"node/10711780640","country_code":"PL","name":"Dworzec Centralny 10","confidence":1,"match_type":"exact","accuracy":"point","country":"Poland","country_gid":"whosonfirst:country:85633723","country_a":"POL","region":"Mazowieckie","region_gid":"whosonfirst:region:85687257","region_a":"MZ","county":"Warszawa","county_gid":"whosonfirst:county:1477743805","localadmin":"Warsaw","localadmin_gid":"whosonfirst:localadmin:1125365875","locality":"Warsaw","locality_gid":"whosonfirst:locality:101752777","borough":"Śródmieście","borough_gid":"whosonfirst:borough:1477921687","neighbourhood":"Śródmieście","neighbourhood_gid":"whosonfirst:neighbourhood:85898119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Dworzec Centralny 10, Warsaw, MZ, Poland","addendum":{"osm":{"wheelchair":"yes","operator":"Tramwaje Warszawskie"}}}}],"bbox":[21.001467,52.228044,21.004029,52.22888]}"; \ No newline at end of file diff --git a/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_d78df13befe54cdb6b327bf6b75a45f2a1cef317 b/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_d78df13befe54cdb6b327bf6b75a45f2a1cef317 index 7091f38fb..4cd1ec4e1 100644 --- a/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_d78df13befe54cdb6b327bf6b75a45f2a1cef317 +++ b/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_d78df13befe54cdb6b327bf6b75a45f2a1cef317 @@ -1 +1 @@ -s:4530:"{"geocoding":{"version":"0.2","attribution":"https://geocode.earth/guidelines","query":{"text":"Hanover","size":5,"layers":["venue","street","country","macroregion","region","county","localadmin","locality","borough","neighbourhood","continent","empire","dependency","macrocounty","macrohood","microhood","disputed","postalcode","ocean","marinearea"],"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","defaulted":true},"querySize":20,"parser":"libpostal","parsed_text":{"city":"hanover"}},"warnings":["performance optimization: excluding 'address' layer"],"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1569514975954},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[9.787455,52.379952]},"properties":{"id":"101748819","gid":"whosonfirst:locality:101748819","layer":"locality","source":"whosonfirst","source_id":"101748819","name":"Hanover","confidence":1,"match_type":"exact","accuracy":"centroid","country":"Germany","country_gid":"whosonfirst:country:85633111","country_a":"DEU","region":"Niedersachsen","region_gid":"whosonfirst:region:85682555","region_a":"NI","county":"Hannover ","county_gid":"whosonfirst:county:102063941","county_a":"HA","locality":"Hanover","locality_gid":"whosonfirst:locality:101748819","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Hanover, Germany"},"bbox":[9.6351335,52.3170855,9.8810641501,52.4482873275]},{"type":"Feature","geometry":{"type":"Point","coordinates":[9.73711,52.37362]},"properties":{"id":"1125331247","gid":"whosonfirst:localadmin:1125331247","layer":"localadmin","source":"whosonfirst","source_id":"1125331247","name":"Hanover","confidence":1,"match_type":"exact","accuracy":"centroid","country":"Germany","country_gid":"whosonfirst:country:85633111","country_a":"DEU","region":"Niedersachsen","region_gid":"whosonfirst:region:85682555","region_a":"NI","county":"Hannover ","county_gid":"whosonfirst:county:102063941","county_a":"HA","localadmin":"Hanover","localadmin_gid":"whosonfirst:localadmin:1125331247","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Hanover, Germany"},"bbox":[9.73711,52.37362,9.73711,52.37362]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-78.107687,18.401137]},"properties":{"id":"85672563","gid":"whosonfirst:region:85672563","layer":"region","source":"whosonfirst","source_id":"85672563","name":"Hanover","confidence":0.3,"match_type":"fallback","accuracy":"centroid","country":"Jamaica","country_gid":"whosonfirst:country:85632215","country_a":"JAM","region":"Hanover","region_gid":"whosonfirst:region:85672563","region_a":"HA","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Hanover, Jamaica"},"bbox":[-78.344668,18.307772,-77.909728,18.462863]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-76.72414,39.19289]},"properties":{"id":"1125874787","gid":"whosonfirst:locality:1125874787","layer":"locality","source":"whosonfirst","source_id":"1125874787","name":"Hanover","confidence":1,"match_type":"exact","accuracy":"centroid","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"Maryland","region_gid":"whosonfirst:region:85688501","region_a":"MD","county":"Howard County","county_gid":"whosonfirst:county:102084263","county_a":"HO","locality":"Hanover","locality_gid":"whosonfirst:locality:1125874787","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Hanover, MD, USA"},"bbox":[-76.72414,39.19289,-76.72414,39.19289]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-70.81199,42.11316]},"properties":{"id":"1125765125","gid":"whosonfirst:locality:1125765125","layer":"locality","source":"whosonfirst","source_id":"1125765125","name":"Hanover","confidence":1,"match_type":"exact","accuracy":"centroid","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"Massachusetts","region_gid":"whosonfirst:region:85688645","region_a":"MA","county":"Plymouth County","county_gid":"whosonfirst:county:102084367","county_a":"PL","localadmin":"Hanover","localadmin_gid":"whosonfirst:localadmin:404476511","locality":"Hanover","locality_gid":"whosonfirst:locality:1125765125","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Hanover, MA, USA"},"bbox":[-70.81199,42.11316,-70.81199,42.11316]}],"bbox":[-78.344668,18.307772,9.8810641501,52.4482873275]}"; \ No newline at end of file +s:4794:"{"geocoding":{"version":"0.2","attribution":"https://geocode.earth/guidelines","query":{"text":"Hanover","size":5,"layers":["venue","street","intersection","postalcode","locality","neighbourhood","county","localadmin","region","macrocounty","country","macroregion","dependency","borough","macrohood","marinearea","disputed","empire","continent","ocean"],"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","via":"default","defaulted":true},"querySize":20,"parser":"libpostal","parsed_text":{"city":"hanover"}},"warnings":["performance optimization: excluding 'address' layer"],"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1742398403329},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[9.787455,52.379952]},"properties":{"id":"101748819","gid":"whosonfirst:locality:101748819","layer":"locality","source":"whosonfirst","source_id":"101748819","country_code":"DE","name":"Hanover","confidence":1,"match_type":"exact","accuracy":"centroid","country":"Germany","country_gid":"whosonfirst:country:85633111","country_a":"DEU","region":"Lower Saxony","region_gid":"whosonfirst:region:85682555","region_a":"NI","county":"Hannover","county_gid":"whosonfirst:county:102063941","county_a":"HA","localadmin":"Hannover","localadmin_gid":"whosonfirst:localadmin:1377686265","locality":"Hanover","locality_gid":"whosonfirst:locality:101748819","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Hanover, NI, Germany"},"bbox":[9.604728,52.305911,9.91856,52.453608]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-78.107687,18.401137]},"properties":{"id":"85672563","gid":"whosonfirst:region:85672563","layer":"region","source":"whosonfirst","source_id":"85672563","country_code":"JM","name":"Hanover","confidence":0.3,"match_type":"fallback","accuracy":"centroid","country":"Jamaica","country_gid":"whosonfirst:country:85632215","country_a":"JAM","region":"Hanover","region_gid":"whosonfirst:region:85672563","region_a":"HA","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Hanover, Jamaica"},"bbox":[-78.344668,18.307772,-77.909728,18.462863]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-76.72414,39.19289]},"properties":{"id":"1125874787","gid":"whosonfirst:locality:1125874787","layer":"locality","source":"whosonfirst","source_id":"1125874787","country_code":"US","name":"Hanover","confidence":1,"match_type":"exact","accuracy":"centroid","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"Maryland","region_gid":"whosonfirst:region:85688501","region_a":"MD","county":"Howard County","county_gid":"whosonfirst:county:102084263","county_a":"HO","locality":"Hanover","locality_gid":"whosonfirst:locality:1125874787","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Hanover, MD, USA"},"bbox":[-76.74414,39.17289,-76.70414,39.21289]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-70.81199,42.11316]},"properties":{"id":"1125765125","gid":"whosonfirst:locality:1125765125","layer":"locality","source":"whosonfirst","source_id":"1125765125","country_code":"US","name":"Hanover","confidence":1,"match_type":"exact","accuracy":"centroid","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"Massachusetts","region_gid":"whosonfirst:region:85688645","region_a":"MA","county":"Plymouth County","county_gid":"whosonfirst:county:102084367","county_a":"PL","localadmin":"Hanover","localadmin_gid":"whosonfirst:localadmin:404476511","locality":"Hanover","locality_gid":"whosonfirst:locality:1125765125","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Hanover, MA, USA"},"bbox":[-70.83199,42.09316,-70.79199,42.13316]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-76.983956,39.811775]},"properties":{"id":"101717245","gid":"whosonfirst:locality:101717245","layer":"locality","source":"whosonfirst","source_id":"101717245","country_code":"US","name":"Hanover","confidence":1,"match_type":"exact","accuracy":"centroid","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"Pennsylvania","region_gid":"whosonfirst:region:85688481","region_a":"PA","county":"York County","county_gid":"whosonfirst:county:102080953","county_a":"YO","localadmin":"Hanover","localadmin_gid":"whosonfirst:localadmin:404487771","locality":"Hanover","locality_gid":"whosonfirst:locality:101717245","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Hanover, PA, USA"},"bbox":[-76.99965,39.791156,-76.963061,39.831769]}],"bbox":[-78.344668,18.307772,9.91856,52.453608]}"; \ No newline at end of file diff --git a/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_ed2668963fd1344d9b3ce41801e79cb0a180d378 b/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_ed2668963fd1344d9b3ce41801e79cb0a180d378 index ffa9f85ba..36401b8f9 100644 --- a/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_ed2668963fd1344d9b3ce41801e79cb0a180d378 +++ b/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_ed2668963fd1344d9b3ce41801e79cb0a180d378 @@ -1 +1 @@ -s:2827:"{"geocoding":{"version":"0.2","attribution":"https://geocode.earth/guidelines","query":{"text":"Kalbacher Hauptstraße 10, 60437 Frankfurt, Germany","size":5,"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","defaulted":true},"querySize":20,"parser":"libpostal","parsed_text":{"street":"kalbacher hauptstraße","number":"10","postalcode":"60437","city":"frankfurt","country":"germany"}},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1569514976454},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[8.636781,50.189017]},"properties":{"id":"de/he/city_of_frankfurtammain:af1f19357b787d33","gid":"openaddresses:address:de/he/city_of_frankfurtammain:af1f19357b787d33","layer":"address","source":"openaddresses","source_id":"de/he/city_of_frankfurtammain:af1f19357b787d33","name":"Kalbacher Hauptstraße 10a","housenumber":"10a","street":"Kalbacher Hauptstraße","postalcode":"60437","confidence":1,"match_type":"exact","accuracy":"point","country":"Germany","country_gid":"whosonfirst:country:85633111","country_a":"DEU","region":"Hessen","region_gid":"whosonfirst:region:85682531","region_a":"HE","macrocounty":"Darmstadt Government Region","macrocounty_gid":"whosonfirst:macrocounty:404227581","county":"Frankfurt","county_gid":"whosonfirst:county:102063589","county_a":"FA","locality":"Frankfurt","locality_gid":"whosonfirst:locality:101913837","neighbourhood":"Römerstadt","neighbourhood_gid":"whosonfirst:neighbourhood:85796311","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Kalbacher Hauptstraße 10a, Frankfurt, Germany"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[8.636575,50.189044]},"properties":{"id":"de/he/city_of_frankfurtammain:f0bbbc440fb8b4b9","gid":"openaddresses:address:de/he/city_of_frankfurtammain:f0bbbc440fb8b4b9","layer":"address","source":"openaddresses","source_id":"de/he/city_of_frankfurtammain:f0bbbc440fb8b4b9","name":"Kalbacher Hauptstraße 10","housenumber":"10","street":"Kalbacher Hauptstraße","postalcode":"60437","confidence":1,"match_type":"exact","accuracy":"point","country":"Germany","country_gid":"whosonfirst:country:85633111","country_a":"DEU","region":"Hessen","region_gid":"whosonfirst:region:85682531","region_a":"HE","macrocounty":"Darmstadt Government Region","macrocounty_gid":"whosonfirst:macrocounty:404227581","county":"Frankfurt","county_gid":"whosonfirst:county:102063589","county_a":"FA","locality":"Frankfurt","locality_gid":"whosonfirst:locality:101913837","neighbourhood":"Römerstadt","neighbourhood_gid":"whosonfirst:neighbourhood:85796311","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Kalbacher Hauptstraße 10, Frankfurt, Germany"}}],"bbox":[8.636575,50.189017,8.636781,50.189044]}"; \ No newline at end of file +s:3066:"{"geocoding":{"version":"0.2","attribution":"https://geocode.earth/guidelines","query":{"text":"Kalbacher Hauptstraße 10, 60437 Frankfurt, Germany","size":5,"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","via":"default","defaulted":true},"querySize":20,"parser":"libpostal","parsed_text":{"street":"kalbacher hauptstraße","housenumber":"10","postalcode":"60437","city":"frankfurt","country":"germany"}},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1742398403782},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[8.636575,50.189044]},"properties":{"id":"de/he/city_of_frankfurtammain:25e39f601bb3bb5d","gid":"openaddresses:address:de/he/city_of_frankfurtammain:25e39f601bb3bb5d","layer":"address","source":"openaddresses","source_id":"de/he/city_of_frankfurtammain:25e39f601bb3bb5d","country_code":"DE","name":"Kalbacher Hauptstraße 10","housenumber":"10","street":"Kalbacher Hauptstraße","postalcode":"60437","confidence":1,"match_type":"exact","accuracy":"point","country":"Germany","country_gid":"whosonfirst:country:85633111","country_a":"DEU","region":"Hesse","region_gid":"whosonfirst:region:85682531","region_a":"HE","macrocounty":"Darmstadt Government Region","macrocounty_gid":"whosonfirst:macrocounty:404227581","county":"Frankfurt","county_gid":"whosonfirst:county:102063589","county_a":"FA","localadmin":"Frankfurt am Main","localadmin_gid":"whosonfirst:localadmin:1377692799","locality":"Frankfurt","locality_gid":"whosonfirst:locality:101913837","neighbourhood":"Römerstadt","neighbourhood_gid":"whosonfirst:neighbourhood:85796311","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Kalbacher Hauptstraße 10, Frankfurt, HE, Germany"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[8.636781,50.189017]},"properties":{"id":"de/he/city_of_frankfurtammain:b6d17159a7ceaecd","gid":"openaddresses:address:de/he/city_of_frankfurtammain:b6d17159a7ceaecd","layer":"address","source":"openaddresses","source_id":"de/he/city_of_frankfurtammain:b6d17159a7ceaecd","country_code":"DE","name":"Kalbacher Hauptstraße 10a","housenumber":"10a","street":"Kalbacher Hauptstraße","postalcode":"60437","confidence":1,"match_type":"exact","accuracy":"point","country":"Germany","country_gid":"whosonfirst:country:85633111","country_a":"DEU","region":"Hesse","region_gid":"whosonfirst:region:85682531","region_a":"HE","macrocounty":"Darmstadt Government Region","macrocounty_gid":"whosonfirst:macrocounty:404227581","county":"Frankfurt","county_gid":"whosonfirst:county:102063589","county_a":"FA","localadmin":"Frankfurt am Main","localadmin_gid":"whosonfirst:localadmin:1377692799","locality":"Frankfurt","locality_gid":"whosonfirst:locality:101913837","neighbourhood":"Römerstadt","neighbourhood_gid":"whosonfirst:neighbourhood:85796311","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Kalbacher Hauptstraße 10a, Frankfurt, HE, Germany"}}],"bbox":[8.636575,50.189017,8.636781,50.189044]}"; \ No newline at end of file diff --git a/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_f4b1af34aaa0731e9b0c345f34266d4825729c2d b/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_f4b1af34aaa0731e9b0c345f34266d4825729c2d index 1015dfd0f..186f02812 100644 --- a/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_f4b1af34aaa0731e9b0c345f34266d4825729c2d +++ b/src/Provider/GeocodeEarth/Tests/.cached_responses/api.geocode.earth_f4b1af34aaa0731e9b0c345f34266d4825729c2d @@ -1 +1 @@ -s:1511:"{"geocoding":{"version":"0.2","attribution":"https://geocode.earth/guidelines","query":{"text":"10 Downing St, London, UK","size":5,"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","defaulted":true},"querySize":20,"parser":"libpostal","parsed_text":{"number":"10","street":"downing st","city":"london","country":"uk"}},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1569514976961},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-0.127636,51.50328]},"properties":{"id":"relation/1879842","gid":"openstreetmap:address:relation/1879842","layer":"address","source":"openstreetmap","source_id":"relation/1879842","name":"10 Downing Street","housenumber":"10","street":"Downing Street","postalcode":"SW1A 2AA","confidence":1,"match_type":"exact","accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","locality":"London","locality_gid":"whosonfirst:locality:101750367","borough":"Westminster","borough_gid":"whosonfirst:borough:1158857245","neighbourhood":"Whitehall","neighbourhood_gid":"whosonfirst:neighbourhood:85793317","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"10 Downing Street, London, England, United Kingdom","addendum":{"osm":{"wikidata":"Q169101","wikipedia":"en:10 Downing Street"}}}}],"bbox":[-0.127636,51.50328,-0.127636,51.50328]}"; \ No newline at end of file +s:1873:"{"geocoding":{"version":"0.2","attribution":"https://geocode.earth/guidelines","query":{"text":"10 Downing St, London, UK","size":5,"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","via":"default","defaulted":true},"querySize":20,"parser":"libpostal","parsed_text":{"housenumber":"10","street":"downing st","city":"london","country":"uk"}},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1742398404646},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-0.127611,51.503335]},"properties":{"id":"relation/1879842","gid":"openstreetmap:address:relation/1879842","layer":"address","source":"openstreetmap","source_id":"relation/1879842","country_code":"GB","name":"10 Downing Street","housenumber":"10","street":"Downing Street","postalcode":"SW1A 2AA","confidence":1,"match_type":"exact","accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Greater London","region_gid":"whosonfirst:region:1880762729","macrocounty":"Greater London","macrocounty_gid":"whosonfirst:macrocounty:1880762179","county":"Lambeth","county_gid":"whosonfirst:county:1880771825","locality":"London","locality_gid":"whosonfirst:locality:101750367","borough":"Westminster","borough_gid":"whosonfirst:borough:1158857245","neighbourhood":"Whitehall","neighbourhood_gid":"whosonfirst:neighbourhood:85793317","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"10 Downing Street, London, England, United Kingdom","addendum":{"osm":{"wikidata":"Q169101","wikipedia":"en:10 Downing Street","website":"https://www.gov.uk/government/organisations/prime-ministers-office-10-downing-street"}}}}],"bbox":[-0.127611,51.503335,-0.127611,51.503335]}"; \ No newline at end of file diff --git a/src/Provider/GeocodeEarth/Tests/GeocodeEarthTest.php b/src/Provider/GeocodeEarth/Tests/GeocodeEarthTest.php index ec72b5383..de12be0ad 100644 --- a/src/Provider/GeocodeEarth/Tests/GeocodeEarthTest.php +++ b/src/Provider/GeocodeEarth/Tests/GeocodeEarthTest.php @@ -49,20 +49,20 @@ public function testGeocodeWithRealAddress(): void $provider = new GeocodeEarth($this->getHttpClient($_SERVER['GEOCODE_EARTH_API_KEY']), $_SERVER['GEOCODE_EARTH_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('242 Acklam Road, London, United Kingdom')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(51.521124, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-0.20360200000000001, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Acklam Road', $result->getStreetName()); $this->assertEquals('London', $result->getLocality()); - $this->assertCount(3, $result->getAdminLevels()); - $this->assertEquals('London', $result->getAdminLevels()->get(3)->getName()); + $this->assertCount(5, $result->getAdminLevels()); + $this->assertEquals('London', $result->getAdminLevels()->get(5)->getName()); $this->assertEquals('United Kingdom', $result->getCountry()->getName()); - $this->assertEquals('GBR', $result->getCountry()->getCode()); + $this->assertEquals('GB', $result->getCountry()->getCode()); } public function testReverseWithRealCoordinates(): void @@ -74,23 +74,23 @@ public function testReverseWithRealCoordinates(): void $provider = new GeocodeEarth($this->getHttpClient($_SERVER['GEOCODE_EARTH_API_KEY']), $_SERVER['GEOCODE_EARTH_API_KEY']); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(54.0484068, -2.7990345)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(54.048411999999999, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(-2.7989549999999999, $result->getCoordinates()->getLongitude(), 0.001); - $this->assertEquals(1, $result->getStreetNumber()); - $this->assertEquals('Gage Street', $result->getStreetName()); - $this->assertEquals('LA1 1UH', $result->getPostalCode()); + $this->assertEquals(11, $result->getStreetNumber()); + $this->assertEquals('Ffrances Passage', $result->getStreetName()); + $this->assertEquals('LA1 1UG', $result->getPostalCode()); $this->assertEquals('Lancaster', $result->getLocality()); - $this->assertCount(4, $result->getAdminLevels()); - $this->assertEquals('Lancashire', $result->getAdminLevels()->get(1)->getName()); - $this->assertEquals('England', $result->getAdminLevels()->get(4)->getName()); + $this->assertCount(5, $result->getAdminLevels()); + $this->assertEquals('Lancashire', $result->getAdminLevels()->get(3)->getName()); + $this->assertEquals('England', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('United Kingdom', $result->getCountry()->getName()); - $this->assertEquals('GBR', $result->getCountry()->getCode()); + $this->assertEquals('GB', $result->getCountry()->getCode()); } public function testReverseWithVillage(): void @@ -102,12 +102,12 @@ public function testReverseWithVillage(): void $provider = new GeocodeEarth($this->getHttpClient($_SERVER['GEOCODE_EARTH_API_KEY']), $_SERVER['GEOCODE_EARTH_API_KEY']); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(49.1390924, 1.6572462)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('Bray-et-Lû', $result->getLocality()); } @@ -120,46 +120,37 @@ public function testGeocodeWithCity(): void $provider = new GeocodeEarth($this->getHttpClient($_SERVER['GEOCODE_EARTH_API_KEY']), $_SERVER['GEOCODE_EARTH_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('Hanover')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(52.379952, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(9.787455, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Hanover', $result->getLocality()); $this->assertCount(4, $result->getAdminLevels()); - $this->assertEquals('Niedersachsen', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('Lower Saxony', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Hanover', $result->getAdminLevels()->get(3)->getName()); $this->assertEquals('Germany', $result->getCountry()->getName()); /** @var \Geocoder\Model\Address $result */ $result = $results->get(1); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); - $this->assertEqualsWithDelta(52.37362, $result->getCoordinates()->getLatitude(), 0.01); - $this->assertEqualsWithDelta(9.73711, $result->getCoordinates()->getLongitude(), 0.01); - $this->assertCount(3, $result->getAdminLevels()); - $this->assertEquals('Niedersachsen', $result->getAdminLevels()->get(1)->getName()); - $this->assertEquals('Germany', $result->getCountry()->getName()); - - /** @var \Geocoder\Model\Address $result */ - $result = $results->get(2); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(18.393428, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-78.107687, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNull($result->getLocality()); - $this->assertCount(2, $result->getAdminLevels()); + $this->assertCount(1, $result->getAdminLevels()); $this->assertEquals('Hanover', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Jamaica', $result->getCountry()->getName()); /** @var \Geocoder\Model\Address $result */ - $result = $results->get(3); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $result = $results->get(2); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(39.192889999999998, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-76.724140000000006, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Hanover', $result->getLocality()); - $this->assertCount(4, $result->getAdminLevels()); + $this->assertCount(3, $result->getAdminLevels()); $this->assertEquals('Hanover', $result->getAdminLevels()->get(3)->getName()); $this->assertEquals('United States', $result->getCountry()->getName()); } @@ -173,24 +164,24 @@ public function testGeocodeWithCityDistrict(): void $provider = new GeocodeEarth($this->getHttpClient($_SERVER['GEOCODE_EARTH_API_KEY']), $_SERVER['GEOCODE_EARTH_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('Kalbacher Hauptstraße 10, 60437 Frankfurt, Germany')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(2, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(50.189017, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(8.6367809999999992, $result->getCoordinates()->getLongitude(), 0.01); - $this->assertEquals('10a', $result->getStreetNumber()); + $this->assertEquals(10, $result->getStreetNumber()); $this->assertEquals('Kalbacher Hauptstraße', $result->getStreetName()); $this->assertEquals(60437, $result->getPostalCode()); $this->assertEquals('Frankfurt', $result->getLocality()); - $this->assertCount(4, $result->getAdminLevels()); - $this->assertEquals('Frankfurt', $result->getAdminLevels()->get(2)->getName()); - $this->assertEquals('Hessen', $result->getAdminLevels()->get(1)->getName()); - $this->assertNull($result->getAdminLevels()->get(1)->getCode()); + $this->assertCount(5, $result->getAdminLevels()); + $this->assertEquals('Frankfurt', $result->getAdminLevels()->get(3)->getName()); + $this->assertEquals('Hesse', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('HE', $result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('Germany', $result->getCountry()->getName()); - $this->assertEquals('DEU', $result->getCountry()->getCode()); + $this->assertEquals('DE', $result->getCountry()->getCode()); } public function testGeocodeNoBounds(): void @@ -202,17 +193,17 @@ public function testGeocodeNoBounds(): void $provider = new GeocodeEarth($this->getHttpClient($_SERVER['GEOCODE_EARTH_API_KEY']), $_SERVER['GEOCODE_EARTH_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('dworzec centralny')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(52.230428, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(21.004552, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Warsaw', $result->getLocality()); $this->assertEquals('Poland', $result->getCountry()->getName()); - $this->assertEquals('POL', $result->getCountry()->getCode()); + $this->assertEquals('PL', $result->getCountry()->getCode()); $this->assertNull($result->getBounds()); } diff --git a/src/Provider/GeocodeEarth/composer.json b/src/Provider/GeocodeEarth/composer.json index 712a993bc..37900c92a 100644 --- a/src/Provider/GeocodeEarth/composer.json +++ b/src/Provider/GeocodeEarth/composer.json @@ -15,7 +15,7 @@ "php": "^8.0", "geocoder-php/common-http": "^4.0", "geocoder-php/pelias-provider": "^1.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/Geoip/Tests/GeoipTest.php b/src/Provider/Geoip/Tests/GeoipTest.php index bb3e41626..28d1c3727 100644 --- a/src/Provider/Geoip/Tests/GeoipTest.php +++ b/src/Provider/Geoip/Tests/GeoipTest.php @@ -52,12 +52,12 @@ public function testGeocodeWithLocalhostIPv4(): void $provider = new Geoip(); $results = $provider->geocodeQuery(GeocodeQuery::create('127.0.0.1')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertNull($result->getCoordinates()); $this->assertNull($result->getPostalCode()); diff --git a/src/Provider/Geoip/composer.json b/src/Provider/Geoip/composer.json index 7e243e758..bcc7dde42 100644 --- a/src/Provider/Geoip/composer.json +++ b/src/Provider/Geoip/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "ext-geoip": "*", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" @@ -42,4 +42,4 @@ "test": "vendor/bin/phpunit", "test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml" } -} \ No newline at end of file +} diff --git a/src/Provider/Geonames/CHANGELOG.md b/src/Provider/Geonames/CHANGELOG.md index f336aaf21..427757ad5 100644 --- a/src/Provider/Geonames/CHANGELOG.md +++ b/src/Provider/Geonames/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.5.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 4.4.0 ### Added diff --git a/src/Provider/Geonames/Tests/CountryInfoTest.php b/src/Provider/Geonames/Tests/CountryInfoTest.php index efcb198da..b67061747 100644 --- a/src/Provider/Geonames/Tests/CountryInfoTest.php +++ b/src/Provider/Geonames/Tests/CountryInfoTest.php @@ -38,8 +38,8 @@ public function testCountryInfoWithOneCountry(): void /* @var CountryInfo $result */ $result = current($results); - $this->assertInstanceOf('Geocoder\Provider\Geonames\Model\CountryInfo', $result); - $this->assertInstanceOf('Geocoder\Model\Bounds', $result->getBounds()); + $this->assertInstanceOf(CountryInfo::class, $result); + $this->assertInstanceOf(\Geocoder\Model\Bounds::class, $result->getBounds()); $this->assertEquals('AS', $result->getContinent()); $this->assertEquals('New Delhi', $result->getCapital()); $this->assertIsArray($result->getLanguages()); diff --git a/src/Provider/Geonames/Tests/GeonamesTest.php b/src/Provider/Geonames/Tests/GeonamesTest.php index 8a9f7117e..9f6b1e06d 100644 --- a/src/Provider/Geonames/Tests/GeonamesTest.php +++ b/src/Provider/Geonames/Tests/GeonamesTest.php @@ -75,11 +75,11 @@ public function testGeocodeWithRealPlace(): void $provider = new Geonames($this->getHttpClient($_SERVER['GEONAMES_USERNAME']), $_SERVER['GEONAMES_USERNAME']); $results = $provider->geocodeQuery(GeocodeQuery::create('Harrods, London')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); /** @var GeonamesAddress $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(51.49957, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-0.16359, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('United Kingdom', $result->getCountry()->getName()); @@ -104,12 +104,12 @@ public function testGeocodeWithMultipleRealPlaces(): void $provider = new Geonames($this->getHttpClient($_SERVER['GEONAMES_USERNAME']), $_SERVER['GEONAMES_USERNAME']); $results = $provider->geocodeQuery(GeocodeQuery::create('London')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(51.508528775863, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-0.12574195861816, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -127,7 +127,7 @@ public function testGeocodeWithMultipleRealPlaces(): void /** @var Location $result */ $result = $results->get(1); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(-33.015285093464, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(27.911624908447, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -146,7 +146,7 @@ public function testGeocodeWithMultipleRealPlaces(): void /** @var Location $result */ $result = $results->get(2); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(51.512788890295, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-0.091838836669922, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -165,7 +165,7 @@ public function testGeocodeWithMultipleRealPlaces(): void /** @var Location $result */ $result = $results->get(3); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(42.983389283, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-81.233042387, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -182,7 +182,7 @@ public function testGeocodeWithMultipleRealPlaces(): void /** @var Location $result */ $result = $results->get(4); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(41.3556539, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-72.0995209, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -208,12 +208,12 @@ public function testGeocodeWithMultipleRealPlacesWithLocale(): void $provider = new Geonames($this->getHttpClient($_SERVER['GEONAMES_USERNAME']), $_SERVER['GEONAMES_USERNAME']); $results = $provider->geocodeQuery(GeocodeQuery::create('London')->withLocale('it_IT')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(51.50853, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-0.12574, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -231,7 +231,7 @@ public function testGeocodeWithMultipleRealPlacesWithLocale(): void /** @var Location $result */ $result = $results->get(1); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(-33.015285093464, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(27.911624908447, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -250,7 +250,7 @@ public function testGeocodeWithMultipleRealPlacesWithLocale(): void /** @var Location $result */ $result = $results->get(2); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(51.512788890295, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-0.091838836669922, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -269,7 +269,7 @@ public function testGeocodeWithMultipleRealPlacesWithLocale(): void /** @var Location $result */ $result = $results->get(3); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(42.983389283, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-81.233042387, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -286,7 +286,7 @@ public function testGeocodeWithMultipleRealPlacesWithLocale(): void /** @var Location $result */ $result = $results->get(4); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(41.3556539, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-72.0995209, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -312,12 +312,12 @@ public function testReverseWithRealCoordinates(): void $provider = new Geonames($this->getHttpClient($_SERVER['GEONAMES_USERNAME']), $_SERVER['GEONAMES_USERNAME']); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(51.50853, -0.12574)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(51.50853, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-0.12574, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('London', $result->getLocality()); @@ -338,12 +338,12 @@ public function testReverseWithRealCoordinatesWithLocale(): void $provider = new Geonames($this->getHttpClient($_SERVER['GEONAMES_USERNAME']), $_SERVER['GEONAMES_USERNAME']); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(51.50853, -0.12574)->withLocale('it_IT')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(51.50853, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-0.12574, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Londra', $result->getLocality()); diff --git a/src/Provider/Geonames/composer.json b/src/Provider/Geonames/composer.json index 7a8bc264a..4b0f1615e 100644 --- a/src/Provider/Geonames/composer.json +++ b/src/Provider/Geonames/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/GoogleMaps/CHANGELOG.md b/src/Provider/GoogleMaps/CHANGELOG.md index 777814a98..b8ef0654d 100644 --- a/src/Provider/GoogleMaps/CHANGELOG.md +++ b/src/Provider/GoogleMaps/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.8.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 4.7.1 ### Fixed diff --git a/src/Provider/GoogleMaps/Tests/GoogleMapsTest.php b/src/Provider/GoogleMaps/Tests/GoogleMapsTest.php index d56d86b11..1e00b5ee1 100644 --- a/src/Provider/GoogleMaps/Tests/GoogleMapsTest.php +++ b/src/Provider/GoogleMaps/Tests/GoogleMapsTest.php @@ -528,7 +528,7 @@ public function testReverseWithSubLocalityLevels(): void /** @var GoogleAddress $result */ $result = $results->first(); $this->assertInstanceOf(Address::class, $result); - $this->assertInstanceOf('\Geocoder\Model\AdminLevelCollection', $result->getSubLocalityLevels()); + $this->assertInstanceOf(\Geocoder\Model\AdminLevelCollection::class, $result->getSubLocalityLevels()); $this->assertEquals('Iijima', $result->getSubLocalityLevels()->get(2)->getName()); $this->assertEquals(false, $result->isPartialMatch()); } @@ -584,7 +584,7 @@ public function testGeocodeDuplicateSubLocalityLevel(): void $this->assertCount(2, $result->getAdminLevels()); $this->assertEquals('Région Wallonne', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Hainaut', $result->getAdminLevels()->get(2)->getName()); - $this->assertInstanceOf('\Geocoder\Model\AdminLevelCollection', $result->getSubLocalityLevels()); + $this->assertInstanceOf(\Geocoder\Model\AdminLevelCollection::class, $result->getSubLocalityLevels()); $this->assertEquals(1, $result->getSubLocalityLevels()->get(1)->getLevel()); $this->assertEquals('Wayaux / Les Bons Villers', $result->getSubLocalityLevels()->get(1)->getName()); $this->assertEquals('Wayaux / Les Bons Villers', $result->getSubLocalityLevels()->get(1)->getCode()); diff --git a/src/Provider/GoogleMaps/composer.json b/src/Provider/GoogleMaps/composer.json index 9ef180b9d..2908c2eee 100644 --- a/src/Provider/GoogleMaps/composer.json +++ b/src/Provider/GoogleMaps/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/GoogleMapsPlaces/CHANGELOG.md b/src/Provider/GoogleMapsPlaces/CHANGELOG.md index 0e1b67b99..e3da8af02 100644 --- a/src/Provider/GoogleMapsPlaces/CHANGELOG.md +++ b/src/Provider/GoogleMapsPlaces/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 1.5.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 1.4.1 ### Fixed diff --git a/src/Provider/GoogleMapsPlaces/composer.json b/src/Provider/GoogleMapsPlaces/composer.json index 0aecc64a0..df354b631 100644 --- a/src/Provider/GoogleMapsPlaces/composer.json +++ b/src/Provider/GoogleMapsPlaces/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/GraphHopper/CHANGELOG.md b/src/Provider/GraphHopper/CHANGELOG.md index 976edfee7..c38216cee 100644 --- a/src/Provider/GraphHopper/CHANGELOG.md +++ b/src/Provider/GraphHopper/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 0.6.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 0.5.0 ### Removed diff --git a/src/Provider/GraphHopper/Tests/GraphHopperTest.php b/src/Provider/GraphHopper/Tests/GraphHopperTest.php index 8d95a1456..c3c5b5626 100644 --- a/src/Provider/GraphHopper/Tests/GraphHopperTest.php +++ b/src/Provider/GraphHopper/Tests/GraphHopperTest.php @@ -43,12 +43,12 @@ public function testGeocodeWithRealAddress(): void $provider = new GraphHopper($this->getHttpClient($_SERVER['GRAPHHOPPER_API_KEY']), $_SERVER['GRAPHHOPPER_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('242 Acklam Road, London, United Kingdom')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(51.521124, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-0.20360200000000001, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Acklam Road', $result->getStreetName()); @@ -65,12 +65,12 @@ public function testGeocodeWithRealAddressAndLocale(): void $provider = new GraphHopper($this->getHttpClient($_SERVER['GRAPHHOPPER_API_KEY']), $_SERVER['GRAPHHOPPER_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('242 Acklam Road, London, United Kingdom')->withLocale('fr')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(51.521124, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-0.20360200000000001, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Acklam Road', $result->getStreetName()); @@ -90,12 +90,12 @@ public function testGeocodeInsideBounds(): void ->withLocale('fr') ->withBounds(new Bounds(50, -10, 55, 10)) ); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(51.521124, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-0.20360200000000001, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Acklam Road', $result->getStreetName()); @@ -115,7 +115,7 @@ public function testGeocodeOutsideBounds(): void ->withLocale('fr') ->withBounds(new Bounds(20, 10, 30, 20)) ); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(0, $results); } @@ -128,12 +128,12 @@ public function testReverseWithRealCoordinates(): void $provider = new GraphHopper($this->getHttpClient($_SERVER['GRAPHHOPPER_API_KEY']), $_SERVER['GRAPHHOPPER_API_KEY']); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(54.0484068, -2.7990345)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->get(1); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(54.048411999999999, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(-2.7989549999999999, $result->getCoordinates()->getLongitude(), 0.001); $this->assertEquals('1', $result->getStreetNumber()); diff --git a/src/Provider/GraphHopper/composer.json b/src/Provider/GraphHopper/composer.json index 43b1750fe..64cd45c38 100644 --- a/src/Provider/GraphHopper/composer.json +++ b/src/Provider/GraphHopper/composer.json @@ -8,7 +8,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/Here/CHANGELOG.md b/src/Provider/Here/CHANGELOG.md index 2e2577aaa..c838a1a0a 100644 --- a/src/Provider/Here/CHANGELOG.md +++ b/src/Provider/Here/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 0.8.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 0.7.1 ### Fixed diff --git a/src/Provider/Here/Tests/HereTest.php b/src/Provider/Here/Tests/HereTest.php index 2f194eeca..3fc9412b5 100644 --- a/src/Provider/Here/Tests/HereTest.php +++ b/src/Provider/Here/Tests/HereTest.php @@ -44,12 +44,12 @@ public function testGeocodeWithRealAddress(): void $results = $provider->geocodeQuery(GeocodeQuery::create('10 avenue Gambetta, Paris, France')->withLocale('fr-FR')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(48.8653, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.39844, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -79,13 +79,13 @@ public function testGeocodeWithDefaultAdditionalData(): void $results = $provider->geocodeQuery(GeocodeQuery::create('Sant Roc, Santa Coloma de Cervelló, Espanya')->withLocale('ca')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var HereAddress $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(41.37854, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.01196, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -125,12 +125,12 @@ public function testGeocodeWithAdditionalData(): void ->withData('IncludeRoutingInformation', 'true') ->withLocale('ca')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var HereAddress $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(41.37854, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.01196, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -175,8 +175,8 @@ public function testGeocodeWithExtraFilterCountry(): void $resultsSpain = $provider->geocodeQuery($queryBarcelonaFromSpain); $resultsVenezuela = $provider->geocodeQuery($queryBarcelonaFromVenezuela); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $resultsSpain); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $resultsVenezuela); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $resultsSpain); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $resultsVenezuela); $this->assertCount(1, $resultsSpain); $this->assertCount(1, $resultsVenezuela); @@ -212,9 +212,9 @@ public function testGeocodeWithExtraFilterCity(): void $resultsCity2 = $provider->geocodeQuery($queryStreetCity2); $resultsCity3 = $provider->geocodeQuery($queryStreetCity3); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $resultsCity1); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $resultsCity2); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $resultsCity3); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $resultsCity1); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $resultsCity2); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $resultsCity3); $resultCity1 = $resultsCity1->first(); $resultCity2 = $resultsCity2->first(); @@ -248,8 +248,8 @@ public function testGeocodeWithExtraFilterCounty(): void $resultsRegion1 = $provider->geocodeQuery($queryCityRegion1); $resultsRegion2 = $provider->geocodeQuery($queryCityRegion2); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $resultsRegion1); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $resultsRegion2); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $resultsRegion1); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $resultsRegion2); /** @var HereAddress $resultRegion1 */ $resultRegion1 = $resultsRegion1->first(); @@ -278,12 +278,12 @@ public function testReverseWithRealCoordinates(): void $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(48.8632156, 2.3887722)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(48.8632147, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(2.3887722, $result->getCoordinates()->getLongitude(), 0.001); $this->assertNotNull($result->getBounds()); diff --git a/src/Provider/Here/composer.json b/src/Provider/Here/composer.json index 1e21732fc..ef89ab88e 100644 --- a/src/Provider/Here/composer.json +++ b/src/Provider/Here/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/HostIp/CHANGELOG.md b/src/Provider/HostIp/CHANGELOG.md index a54abd58a..1056dae67 100644 --- a/src/Provider/HostIp/CHANGELOG.md +++ b/src/Provider/HostIp/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.5.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 4.4.0 ### Added diff --git a/src/Provider/HostIp/Tests/HostIpTest.php b/src/Provider/HostIp/Tests/HostIpTest.php index 97f5450d4..7564441b0 100644 --- a/src/Provider/HostIp/Tests/HostIpTest.php +++ b/src/Provider/HostIp/Tests/HostIpTest.php @@ -45,12 +45,12 @@ public function testGeocodeWithLocalhostIPv4(): void $provider = new HostIp($this->getMockedHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('127.0.0.1')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertNull($result->getCoordinates()); $this->assertNull($result->getPostalCode()); @@ -75,12 +75,12 @@ public function testGeocodeWithRealIPv4(): void $provider = new HostIp($this->getHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('88.188.221.14')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals(null, $result->getCoordinates()); $this->assertNull($result->getPostalCode()); $this->assertEquals('Aulnat', $result->getLocality()); @@ -112,12 +112,12 @@ public function testGeocodeWithAnotherIp(): void $provider = new HostIp($this->getHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('33.33.33.22')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertNull($result->getCoordinates()); } } diff --git a/src/Provider/HostIp/Tests/HostIpXmlTest.php b/src/Provider/HostIp/Tests/HostIpXmlTest.php index 746c7bea0..524904be8 100644 --- a/src/Provider/HostIp/Tests/HostIpXmlTest.php +++ b/src/Provider/HostIp/Tests/HostIpXmlTest.php @@ -45,12 +45,12 @@ public function testGeocodeWithLocalhostIPv4(): void $provider = new HostIpXml($this->getMockedHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('127.0.0.1')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertNull($result->getCoordinates()); $this->assertNull($result->getPostalCode()); @@ -75,12 +75,12 @@ public function testGeocodeWithRealIPv4(): void $provider = new HostIpXml($this->getHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('77.38.216.139')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(56.8833, $result->getCoordinates()->getLatitude(), 0.0001); $this->assertEqualsWithDelta(24.0833, $result->getCoordinates()->getLongitude(), 0.0001); $this->assertNull($result->getPostalCode()); @@ -113,12 +113,12 @@ public function testGeocodeWithAnotherIp(): void $provider = new HostIpXml($this->getHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('33.33.33.22')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertNull($result->getCoordinates()); } } diff --git a/src/Provider/HostIp/composer.json b/src/Provider/HostIp/composer.json index 1b92133f1..18b3cc636 100644 --- a/src/Provider/HostIp/composer.json +++ b/src/Provider/HostIp/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/IP2Location/CHANGELOG.md b/src/Provider/IP2Location/CHANGELOG.md index ff6d3e595..f4018d53f 100644 --- a/src/Provider/IP2Location/CHANGELOG.md +++ b/src/Provider/IP2Location/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 1.4.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 1.3.0 ### Added diff --git a/src/Provider/IP2Location/Tests/IP2LocationTest.php b/src/Provider/IP2Location/Tests/IP2LocationTest.php index 82bf8e052..244a55ebe 100644 --- a/src/Provider/IP2Location/Tests/IP2LocationTest.php +++ b/src/Provider/IP2Location/Tests/IP2LocationTest.php @@ -76,12 +76,12 @@ public function testGeocodeWithRealIPv4(): void $provider = new IP2Location($this->getHttpClient($_SERVER['IP2LOCATION_API_KEY']), $_SERVER['IP2LOCATION_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('74.125.45.100')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(36.154, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(-95.9928, $result->getCoordinates()->getLongitude(), 0.001); $this->assertEquals(74101, $result->getPostalCode()); @@ -101,12 +101,12 @@ public function testGeocodeWithRealIPv6(): void $provider = new IP2Location($this->getHttpClient($_SERVER['IP2LOCATION_API_KEY']), $_SERVER['IP2LOCATION_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('::ffff:74.125.45.100')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(36.154, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(-95.9928, $result->getCoordinates()->getLongitude(), 0.001); $this->assertEquals(74101, $result->getPostalCode()); diff --git a/src/Provider/IP2Location/composer.json b/src/Provider/IP2Location/composer.json index a9ae73f47..fe21fe03d 100644 --- a/src/Provider/IP2Location/composer.json +++ b/src/Provider/IP2Location/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/IP2LocationBinary/CHANGELOG.md b/src/Provider/IP2LocationBinary/CHANGELOG.md index 02227b27c..88c386f00 100644 --- a/src/Provider/IP2LocationBinary/CHANGELOG.md +++ b/src/Provider/IP2LocationBinary/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 1.4.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 1.3.1 ### Changed diff --git a/src/Provider/IP2LocationBinary/Tests/IP2LocationBinaryTest.php b/src/Provider/IP2LocationBinary/Tests/IP2LocationBinaryTest.php index 6093e52c9..242c7bd5c 100644 --- a/src/Provider/IP2LocationBinary/Tests/IP2LocationBinaryTest.php +++ b/src/Provider/IP2LocationBinary/Tests/IP2LocationBinaryTest.php @@ -64,12 +64,12 @@ public function testLocationResultContainsExpectedFieldsForAnAmericanIp(): void $provider = new IP2LocationBinary($this->binaryFile); $results = $provider->geocodeQuery(GeocodeQuery::create('8.8.8.8')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(37.405990600586, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(-122.07851409912, $result->getCoordinates()->getLongitude(), 0.001); @@ -92,12 +92,12 @@ public function testLocationResultContainsExpectedFieldsForAChinaIp(): void $provider = new IP2LocationBinary($this->binaryFile); $results = $provider->geocodeQuery(GeocodeQuery::create('123.123.123.123')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(39.907501220703, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(116.39723205566, $result->getCoordinates()->getLongitude(), 0.001); @@ -120,12 +120,12 @@ public function testGeocodeWithRealIPv6(): void $provider = new IP2LocationBinary($this->binaryFile); $results = $provider->geocodeQuery(GeocodeQuery::create('2001:4860:4860::8888')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(37.386051, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(-122.083847, $result->getCoordinates()->getLongitude(), 0.001); @@ -151,12 +151,12 @@ public function testFindLocationByIp(string $ip, ?string $expectedCity, ?string $provider = new IP2LocationBinary($this->binaryFile); $results = $provider->geocodeQuery(GeocodeQuery::create($ip)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals($expectedCity, $result->getLocality()); $this->assertEquals($expectedCountry, $result->getCountry()->getName()); } diff --git a/src/Provider/IP2LocationBinary/composer.json b/src/Provider/IP2LocationBinary/composer.json index ae178a4fa..0b889e488 100644 --- a/src/Provider/IP2LocationBinary/composer.json +++ b/src/Provider/IP2LocationBinary/composer.json @@ -15,7 +15,7 @@ "php": "^8.0", "ip2location/ip2location-php": "^8.1.1", "symfony/polyfill-mbstring": "^1.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/IpInfo/CHANGELOG.md b/src/Provider/IpInfo/CHANGELOG.md index 0cc20869e..62563c8d5 100644 --- a/src/Provider/IpInfo/CHANGELOG.md +++ b/src/Provider/IpInfo/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 0.5.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 0.4.0 ### Added diff --git a/src/Provider/IpInfo/Tests/IpInfoTest.php b/src/Provider/IpInfo/Tests/IpInfoTest.php index 6346a7b3f..815f3cf15 100644 --- a/src/Provider/IpInfo/Tests/IpInfoTest.php +++ b/src/Provider/IpInfo/Tests/IpInfoTest.php @@ -55,12 +55,12 @@ public function testGeocodeWithLocalhost(string $localhostIp): void $provider = new IpInfo($this->getMockedHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create($localhostIp)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertNull($result->getCoordinates()); $this->assertNull($result->getPostalCode()); @@ -93,12 +93,12 @@ public function testGeocodeWithRealIPv4(): void $provider = new IpInfo($this->getHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('74.125.45.100')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(36.154, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(-95.9928, $result->getCoordinates()->getLongitude(), 0.001); $this->assertEquals(74102, $result->getPostalCode()); @@ -115,12 +115,12 @@ public function testGeocodeWithRealIPv6(): void $provider = new IpInfo($this->getHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('2601:9:7680:363:75df:f491:6f85:352f')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(39.934, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(-74.891, $result->getCoordinates()->getLongitude(), 0.001); $this->assertEquals('08054', $result->getPostalCode()); diff --git a/src/Provider/IpInfo/composer.json b/src/Provider/IpInfo/composer.json index a29e6353f..0f2171641 100644 --- a/src/Provider/IpInfo/composer.json +++ b/src/Provider/IpInfo/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/IpInfoDb/CHANGELOG.md b/src/Provider/IpInfoDb/CHANGELOG.md index e11fec22d..8dded5db0 100644 --- a/src/Provider/IpInfoDb/CHANGELOG.md +++ b/src/Provider/IpInfoDb/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.4.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 4.3.0 ### Added diff --git a/src/Provider/IpInfoDb/Tests/IpInfoDbTest.php b/src/Provider/IpInfoDb/Tests/IpInfoDbTest.php index 56c1c7287..b30a1d9d5 100644 --- a/src/Provider/IpInfoDb/Tests/IpInfoDbTest.php +++ b/src/Provider/IpInfoDb/Tests/IpInfoDbTest.php @@ -62,12 +62,12 @@ public function testGeocodeWithLocalhostIPv4(): void $provider = new IpInfoDb($this->getMockedHttpClient(), 'api_key'); $results = $provider->geocodeQuery(GeocodeQuery::create('127.0.0.1')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertNull($result->getCoordinates()); $this->assertNull($result->getPostalCode()); @@ -112,12 +112,12 @@ public function testGeocodeWithRealIPv4(): void $provider = new IpInfoDb($this->getHttpClient($_SERVER['IPINFODB_API_KEY']), $_SERVER['IPINFODB_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('74.125.45.100')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(36.154, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(-95.9928, $result->getCoordinates()->getLongitude(), 0.001); $this->assertEquals(74101, $result->getPostalCode()); @@ -154,12 +154,12 @@ public function testGetGeocodedDataWithCountryPrecision(): void $provider = new IpInfoDb($this->getHttpClient($_SERVER['IPINFODB_API_KEY']), $_SERVER['IPINFODB_API_KEY'], 'country'); $results = $provider->geocodeQuery(GeocodeQuery::create('74.125.45.100')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertNull($result->getCoordinates()); $this->assertNull($result->getPostalCode()); diff --git a/src/Provider/IpInfoDb/composer.json b/src/Provider/IpInfoDb/composer.json index 1bf60363a..dc16fbd77 100644 --- a/src/Provider/IpInfoDb/composer.json +++ b/src/Provider/IpInfoDb/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/Ipstack/CHANGELOG.md b/src/Provider/Ipstack/CHANGELOG.md index 0cc20869e..c807033e1 100644 --- a/src/Provider/Ipstack/CHANGELOG.md +++ b/src/Provider/Ipstack/CHANGELOG.md @@ -2,6 +2,23 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 0.6.0 + +### Added + +- Add support for PHP Geocoder 5 + +## 0.5.0 + +### Added + +- Add support for PHP 8.3 and 8.4 +- Add support for region name (as admin level) + +### Removed + +- Drop support for PHP 7.4 + ## 0.4.0 ### Added diff --git a/src/Provider/Ipstack/Ipstack.php b/src/Provider/Ipstack/Ipstack.php index 29a6a14e4..eff4ac72f 100644 --- a/src/Provider/Ipstack/Ipstack.php +++ b/src/Provider/Ipstack/Ipstack.php @@ -73,6 +73,21 @@ public function geocodeQuery(GeocodeQuery $query): Collection $url = sprintf('%s&language=%s', $url, $query->getLocale()); } + return $this->executeQuery($url); + } + + public function reverseQuery(ReverseQuery $query): Collection + { + throw new UnsupportedOperation('The Ipstack provider is not able to do reverse geocoding.'); + } + + public function getName(): string + { + return 'ipstack'; + } + + private function executeQuery(string $url): AddressCollection + { $body = $this->getUrlContents($url); $data = json_decode($body, true); @@ -99,26 +114,17 @@ public function geocodeQuery(GeocodeQuery $query): Collection return new AddressCollection([]); } - $locations[] = Address::createFromArray([ - 'providedBy' => $this->getName(), - 'latitude' => $data['latitude'] ?: null, - 'longitude' => $data['longitude'] ?: null, - 'locality' => $data['city'] ?: null, - 'postalCode' => $data['zip'] ?: null, - 'country' => $data['country_name'] ?: null, - 'countryCode' => $data['country_code'] ?: null, + return new AddressCollection([ + Address::createFromArray([ + 'providedBy' => $this->getName(), + 'latitude' => $data['latitude'] ?? null, + 'longitude' => $data['longitude'] ?? null, + 'locality' => $data['city'] ?? null, + 'postalCode' => $data['zip'] ?? null, + 'country' => $data['country_name'] ?? null, + 'adminLevels' => isset($data['region_name']) ? [['name' => $data['region_name'], 'level' => 1]] : [], + 'countryCode' => $data['country_code'] ?? null, + ]), ]); - - return new AddressCollection($locations); - } - - public function reverseQuery(ReverseQuery $query): Collection - { - throw new UnsupportedOperation('The Ipstack provider is not able to do reverse geocoding.'); - } - - public function getName(): string - { - return 'ipstack'; } } diff --git a/src/Provider/Ipstack/Tests/.cached_responses/api.ipstack.com_8c54dbc41778b06f3d6701959abd823ece0ac790 b/src/Provider/Ipstack/Tests/.cached_responses/api.ipstack.com_8c54dbc41778b06f3d6701959abd823ece0ac790 index a1eacec32..59e2e663f 100644 --- a/src/Provider/Ipstack/Tests/.cached_responses/api.ipstack.com_8c54dbc41778b06f3d6701959abd823ece0ac790 +++ b/src/Provider/Ipstack/Tests/.cached_responses/api.ipstack.com_8c54dbc41778b06f3d6701959abd823ece0ac790 @@ -1 +1 @@ -s:562:"{"ip":"74.200.247.59","type":"ipv4","continent_code":"NA","continent_name":"Am\u00e9rique du Nord","country_code":"US","country_name":"\u00c9tats-Unis","region_code":null,"region_name":null,"city":null,"zip":null,"latitude":37.751,"longitude":-97.822,"location":{"geoname_id":null,"capital":"Washington D.C.","languages":[{"code":"en","name":"English","native":"English"}],"country_flag":"http:\/\/assets.ipstack.com\/flags\/us.svg","country_flag_emoji":"\ud83c\uddfa\ud83c\uddf8","country_flag_emoji_unicode":"U+1F1FA U+1F1F8","calling_code":"1","is_eu":false}}"; \ No newline at end of file +s:1120:"{"ip":"74.200.247.59","type":"ipv4","continent_code":"NA","continent_name":"Am\u00e9rique du Nord","country_code":"US","country_name":"\u00c9tats-Unis","region_code":"NJ","region_name":"New Jersey","city":"Jersey City","zip":"07311","latitude":40.724,"longitude":-74.059,"msa":"35620","dma":"501","radius":null,"ip_routing_type":"fixed","connection_type":"tx","location":{"geoname_id":5099836,"capital":"Washington D.C.","languages":[{"code":"en","name":"English","native":"English"}],"country_flag":"https://assets.ipstack.com/flags/us.svg","country_flag_emoji":"\ud83c\uddfa\ud83c\uddf8","country_flag_emoji_unicode":"U+1F1FA U+1F1F8","calling_code":"1","is_eu":false},"time_zone":{"id":"America/New_York","current_time":"2025-02-16T06:13:52-05:00","gmt_offset":-18000,"code":"EST","is_daylight_saving":false},"currency":{"code":"USD","name":"US Dollar","plural":"US dollars","symbol":"$","symbol_native":"$"},"connection":{"asn":19994,"isp":"Rackspace Hosting","sld":null,"tld":null,"carrier":"rackspace hosting","home":false,"organization_type":"Internet Hosting Services","isic_code":"J6311","naics_code":"518210"}}"; \ No newline at end of file diff --git a/src/Provider/Ipstack/Tests/.cached_responses/api.ipstack.com_f92238d9cf3edf827c645b7d7b20046b310dbf29 b/src/Provider/Ipstack/Tests/.cached_responses/api.ipstack.com_f92238d9cf3edf827c645b7d7b20046b310dbf29 index 23138a6a6..07d94baf9 100644 --- a/src/Provider/Ipstack/Tests/.cached_responses/api.ipstack.com_f92238d9cf3edf827c645b7d7b20046b310dbf29 +++ b/src/Provider/Ipstack/Tests/.cached_responses/api.ipstack.com_f92238d9cf3edf827c645b7d7b20046b310dbf29 @@ -1 +1 @@ -s:552:"{"ip":"74.200.247.59","type":"ipv4","continent_code":"NA","continent_name":"North America","country_code":"US","country_name":"United States","region_code":null,"region_name":null,"city":null,"zip":null,"latitude":37.751,"longitude":-97.822,"location":{"geoname_id":null,"capital":"Washington D.C.","languages":[{"code":"en","name":"English","native":"English"}],"country_flag":"http:\/\/assets.ipstack.com\/flags\/us.svg","country_flag_emoji":"\ud83c\uddfa\ud83c\uddf8","country_flag_emoji_unicode":"U+1F1FA U+1F1F8","calling_code":"1","is_eu":false}}"; \ No newline at end of file +s:1110:"{"ip":"74.200.247.59","type":"ipv4","continent_code":"NA","continent_name":"North America","country_code":"US","country_name":"United States","region_code":"NJ","region_name":"New Jersey","city":"Jersey City","zip":"07311","latitude":40.724,"longitude":-74.059,"msa":"35620","dma":"501","radius":null,"ip_routing_type":"fixed","connection_type":"tx","location":{"geoname_id":5099836,"capital":"Washington D.C.","languages":[{"code":"en","name":"English","native":"English"}],"country_flag":"https://assets.ipstack.com/flags/us.svg","country_flag_emoji":"\ud83c\uddfa\ud83c\uddf8","country_flag_emoji_unicode":"U+1F1FA U+1F1F8","calling_code":"1","is_eu":false},"time_zone":{"id":"America/New_York","current_time":"2025-02-16T06:03:06-05:00","gmt_offset":-18000,"code":"EST","is_daylight_saving":false},"currency":{"code":"USD","name":"US Dollar","plural":"US dollars","symbol":"$","symbol_native":"$"},"connection":{"asn":19994,"isp":"Rackspace Hosting","sld":null,"tld":null,"carrier":"rackspace hosting","home":false,"organization_type":"Internet Hosting Services","isic_code":"J6311","naics_code":"518210"}}"; \ No newline at end of file diff --git a/src/Provider/Ipstack/Tests/IpstackTest.php b/src/Provider/Ipstack/Tests/IpstackTest.php index f8a53d77d..34e8be77d 100644 --- a/src/Provider/Ipstack/Tests/IpstackTest.php +++ b/src/Provider/Ipstack/Tests/IpstackTest.php @@ -56,14 +56,15 @@ public function testGeocodeWithLocalhostIPv4(): void $provider = new Ipstack($this->getMockedHttpClient(), 'api_key'); $results = $provider->geocodeQuery(GeocodeQuery::create('127.0.0.1')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('localhost', $result->getLocality()); $this->assertEquals('localhost', $result->getCountry()->getName()); + $this->assertEmpty($result->getAdminLevels()); } public function testGeocodeWithLocalhostIPv6(): void @@ -71,14 +72,15 @@ public function testGeocodeWithLocalhostIPv6(): void $provider = new Ipstack($this->getMockedHttpClient(), 'api_key'); $results = $provider->geocodeQuery(GeocodeQuery::create('::1')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('localhost', $result->getLocality()); $this->assertEquals('localhost', $result->getCountry()->getName()); + $this->assertEmpty($result->getAdminLevels()); } public function testGeocodeWithRealIPv4(): void @@ -86,16 +88,18 @@ public function testGeocodeWithRealIPv4(): void $provider = new Ipstack($this->getHttpClient($_SERVER['IPSTACK_API_KEY']), $_SERVER['IPSTACK_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('74.200.247.59')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); - $this->assertEqualsWithDelta(37.751, $result->getCoordinates()->getLatitude(), 0.01); - $this->assertEqualsWithDelta(-97.822, $result->getCoordinates()->getLongitude(), 0.01); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); + $this->assertEqualsWithDelta(40.724, $result->getCoordinates()->getLatitude(), 0.01); + $this->assertEqualsWithDelta(-74.059, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('United States', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('New Jersey', $result->getAdminLevels()->get(1)->getName()); } public function testGeocodeWithRealIPv4InFrench(): void @@ -103,16 +107,18 @@ public function testGeocodeWithRealIPv4InFrench(): void $provider = new Ipstack($this->getHttpClient($_SERVER['IPSTACK_API_KEY']), $_SERVER['IPSTACK_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('74.200.247.59')->withLocale('fr')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); - $this->assertEqualsWithDelta(37.751, $result->getCoordinates()->getLatitude(), 0.01); - $this->assertEqualsWithDelta(-97.822, $result->getCoordinates()->getLongitude(), 0.01); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); + $this->assertEqualsWithDelta(40.724, $result->getCoordinates()->getLatitude(), 0.01); + $this->assertEqualsWithDelta(-74.059, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('États-Unis', $result->getCountry()->getName()); $this->assertEquals('US', $result->getCountry()->getCode()); + $this->assertCount(1, $result->getAdminLevels()); + $this->assertEquals('New Jersey', $result->getAdminLevels()->get(1)->getName()); } public function testReverse(): void diff --git a/src/Provider/Ipstack/composer.json b/src/Provider/Ipstack/composer.json index 1764b8ed3..3946aa492 100644 --- a/src/Provider/Ipstack/composer.json +++ b/src/Provider/Ipstack/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/LocationIQ/CHANGELOG.md b/src/Provider/LocationIQ/CHANGELOG.md index f8b2ddf97..54308d5d7 100644 --- a/src/Provider/LocationIQ/CHANGELOG.md +++ b/src/Provider/LocationIQ/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 1.5.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 1.4.0 ### Removed diff --git a/src/Provider/LocationIQ/Tests/LocationIQTest.php b/src/Provider/LocationIQ/Tests/LocationIQTest.php index 5c2ab151d..dc60da86b 100644 --- a/src/Provider/LocationIQ/Tests/LocationIQTest.php +++ b/src/Provider/LocationIQ/Tests/LocationIQTest.php @@ -79,12 +79,12 @@ public function testGetNodeStreetName(): void $provider = new LocationIQ($this->getHttpClient($_SERVER['LOCATIONIQ_API_KEY']), $_SERVER['LOCATIONIQ_API_KEY']); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(48.86, 2.35)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('Rue Quincampoix', $result->getStreetName()); } } diff --git a/src/Provider/LocationIQ/composer.json b/src/Provider/LocationIQ/composer.json index b65f31475..af4b6d52d 100644 --- a/src/Provider/LocationIQ/composer.json +++ b/src/Provider/LocationIQ/composer.json @@ -19,7 +19,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "require-dev": { "geocoder-php/provider-integration-tests": "^1.6.3", diff --git a/src/Provider/MapQuest/CHANGELOG.md b/src/Provider/MapQuest/CHANGELOG.md index 14e0da283..a4f4d9f31 100644 --- a/src/Provider/MapQuest/CHANGELOG.md +++ b/src/Provider/MapQuest/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.4.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 4.3.0 ### Added diff --git a/src/Provider/MapQuest/Tests/MapQuestTest.php b/src/Provider/MapQuest/Tests/MapQuestTest.php index c85a71f84..38b03982c 100644 --- a/src/Provider/MapQuest/Tests/MapQuestTest.php +++ b/src/Provider/MapQuest/Tests/MapQuestTest.php @@ -67,12 +67,12 @@ public function testGeocodeWithRealAddress(): void $provider = new MapQuest($this->getHttpClient($_SERVER['MAPQUEST_API_KEY']), $_SERVER['MAPQUEST_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('10 avenue Gambetta, Paris, France')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(2, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(48.866205, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.389089, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('10 Avenue Gambetta', $result->getStreetName()); @@ -90,7 +90,7 @@ public function testGeocodeWithRealAddress(): void $this->assertNull($result->getTimezone()); $result = $results->get(1); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(48.810071, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.435937, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('10 Avenue Gambetta', $result->getStreetName()); @@ -134,12 +134,12 @@ public function testGeocodeWithRealSpecificAddress(): void $query = $query->withData(MapQuest::DATA_KEY_ADDRESS, $address); $results = $provider->geocodeQuery($query); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(36.062933, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-86.672811, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Payne Road', $result->getStreetName()); @@ -166,12 +166,12 @@ public function testReverseWithRealCoordinates(): void $provider = new MapQuest($this->getHttpClient($_SERVER['MAPQUEST_API_KEY']), $_SERVER['MAPQUEST_API_KEY']); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(54.0484068, -2.7990345)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(54.0484068, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(-2.7990345, $result->getCoordinates()->getLongitude(), 0.001); $this->assertEquals('Collegian W.M.C.', $result->getStreetName()); @@ -197,14 +197,14 @@ public function testGeocodeWithCity(): void $provider = new MapQuest($this->getHttpClient($_SERVER['MAPQUEST_API_KEY']), $_SERVER['MAPQUEST_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('Hanover')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); $resultsArray = $results->all(); /** @var Location $result */ $result = reset($resultsArray); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(52.374478, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(9.738553, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Hanover', $result->getLocality()); @@ -216,7 +216,7 @@ public function testGeocodeWithCity(): void /** @var Location $result */ $result = next($resultsArray); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(18.384049, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-78.131485, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('', $result->getLocality()); @@ -227,7 +227,7 @@ public function testGeocodeWithCity(): void /** @var Location $result */ $result = next($resultsArray); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(43.703622, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-72.288666, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Hanover', $result->getLocality()); @@ -239,7 +239,7 @@ public function testGeocodeWithCity(): void /** @var Location $result */ $result = next($resultsArray); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(39.806325, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-76.984273, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Hanover', $result->getLocality()); @@ -251,7 +251,7 @@ public function testGeocodeWithCity(): void /** @var Location $result */ $result = next($resultsArray); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(37.744783, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-77.446416, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('', $result->getLocality()); @@ -278,14 +278,14 @@ public function testGeocodeWithSpecificCity(): void $query = $query->withData(MapQuest::DATA_KEY_ADDRESS, $address); $results = $provider->geocodeQuery($query); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); $resultsArray = $results->all(); /** @var Location $result */ $result = reset($resultsArray); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(52.374478, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(9.738553, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Hanover', $result->getLocality()); @@ -297,7 +297,7 @@ public function testGeocodeWithSpecificCity(): void /** @var Location $result */ $result = next($resultsArray); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(43.703622, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-72.288666, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Hanover', $result->getLocality()); @@ -309,7 +309,7 @@ public function testGeocodeWithSpecificCity(): void /** @var Location $result */ $result = next($resultsArray); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(39.806325, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-76.984273, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Hanover', $result->getLocality()); @@ -321,7 +321,7 @@ public function testGeocodeWithSpecificCity(): void /** @var Location $result */ $result = next($resultsArray); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(40.661764, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-75.412404, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Hanover', $result->getLocality()); @@ -333,7 +333,7 @@ public function testGeocodeWithSpecificCity(): void /** @var Location $result */ $result = next($resultsArray); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(40.651401, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-75.440663, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Hanover', $result->getLocality()); @@ -361,14 +361,14 @@ public function testGeocodeWithSpecificCityAndBounds(): void $query = $query->withBounds(new Bounds(39, -77, 41, -75)); $results = $provider->geocodeQuery($query); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); $resultsArray = $results->all(); /** @var Location $result */ $result = reset($resultsArray); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('17331', $result->getPostalCode()); $this->assertEqualsWithDelta(39.806325, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-76.984273, $result->getCoordinates()->getLongitude(), 0.01); @@ -381,7 +381,7 @@ public function testGeocodeWithSpecificCityAndBounds(): void /** @var Location $result */ $result = next($resultsArray); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(40.661764, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-75.412404, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Hanover', $result->getLocality()); @@ -393,7 +393,7 @@ public function testGeocodeWithSpecificCityAndBounds(): void /** @var Location $result */ $result = next($resultsArray); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(40.651401, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-75.440663, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Hanover', $result->getLocality()); @@ -405,7 +405,7 @@ public function testGeocodeWithSpecificCityAndBounds(): void /** @var Location $result */ $result = next($resultsArray); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('20794:21076', $result->getPostalCode()); $this->assertEqualsWithDelta(39.192885, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-76.724137, $result->getCoordinates()->getLongitude(), 0.01); @@ -418,7 +418,7 @@ public function testGeocodeWithSpecificCityAndBounds(): void /** @var Location $result */ $result = next($resultsArray); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(52.374478, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(9.738553, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Hanover', $result->getLocality()); @@ -438,12 +438,12 @@ public function testGeocodeWithCityDistrict(): void $provider = new MapQuest($this->getHttpClient($_SERVER['MAPQUEST_API_KEY']), $_SERVER['MAPQUEST_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('Kalbacher Hauptstraße 10, 60437 Frankfurt, Germany')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(50.189062, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(8.636567, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Kalbacher Hauptstraße 10', $result->getStreetName()); diff --git a/src/Provider/MapQuest/composer.json b/src/Provider/MapQuest/composer.json index a2bed3166..3d7e9d964 100644 --- a/src/Provider/MapQuest/composer.json +++ b/src/Provider/MapQuest/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.6", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/MapTiler/CHANGELOG.md b/src/Provider/MapTiler/CHANGELOG.md index 00ad16523..259468441 100644 --- a/src/Provider/MapTiler/CHANGELOG.md +++ b/src/Provider/MapTiler/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 1.2.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 1.1.0 ### Removed diff --git a/src/Provider/MapTiler/Tests/MapTilerTest.php b/src/Provider/MapTiler/Tests/MapTilerTest.php index 3bef6143f..c0e1ee6c3 100644 --- a/src/Provider/MapTiler/Tests/MapTilerTest.php +++ b/src/Provider/MapTiler/Tests/MapTilerTest.php @@ -79,12 +79,12 @@ public function testGeocodeQueryStreet(): void $provider = new MapTiler($this->getHttpClient($_SERVER['MAPTILER_KEY']), $_SERVER['MAPTILER_KEY']); $results = $provider->geocodeQuery($query); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); // $this->assertCount(1, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(48.8658863, $result->getCoordinates()->getLatitude(), 0.00001); $this->assertEqualsWithDelta(2.3993232, $result->getCoordinates()->getLongitude(), 0.00001); $this->assertEquals('Avenue Gambetta', $result->getStreetName()); @@ -103,12 +103,12 @@ public function testGeocodeQueryCity(): void $provider = new MapTiler($this->getHttpClient($_SERVER['MAPTILER_KEY']), $_SERVER['MAPTILER_KEY']); $results = $provider->geocodeQuery($query); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); // $this->assertCount(1, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->get(1); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(48.85881, $result->getCoordinates()->getLatitude(), 0.00001); $this->assertEqualsWithDelta(2.320031, $result->getCoordinates()->getLongitude(), 0.00001); $this->assertEquals('Paris', $result->getLocality()); @@ -126,12 +126,12 @@ public function testReverseQuery(): void $provider = new MapTiler($this->getHttpClient($_SERVER['MAPTILER_KEY']), $_SERVER['MAPTILER_KEY']); $results = $provider->reverseQuery($query); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); // $this->assertCount(1, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(47.3774434, $result->getCoordinates()->getLatitude(), 0.00001); $this->assertEqualsWithDelta(8.528509, $result->getCoordinates()->getLongitude(), 0.00001); $this->assertEquals('Zurich', $result->getLocality()); diff --git a/src/Provider/MapTiler/composer.json b/src/Provider/MapTiler/composer.json index 0eb201538..f05322d75 100644 --- a/src/Provider/MapTiler/composer.json +++ b/src/Provider/MapTiler/composer.json @@ -13,7 +13,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.1", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/Mapbox/CHANGELOG.md b/src/Provider/Mapbox/CHANGELOG.md index 471823b3f..214529e6a 100644 --- a/src/Provider/Mapbox/CHANGELOG.md +++ b/src/Provider/Mapbox/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 1.5.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 1.4.0 ### Added diff --git a/src/Provider/Mapbox/composer.json b/src/Provider/Mapbox/composer.json index 3eb92e1e7..c88d0d47c 100644 --- a/src/Provider/Mapbox/composer.json +++ b/src/Provider/Mapbox/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/Mapzen/Tests/MapzenTest.php b/src/Provider/Mapzen/Tests/MapzenTest.php index 89354174b..ddc2892c3 100644 --- a/src/Provider/Mapzen/Tests/MapzenTest.php +++ b/src/Provider/Mapzen/Tests/MapzenTest.php @@ -61,12 +61,12 @@ public function testGeocodeWithRealAddress(): void $provider = new Mapzen($this->getHttpClient($_SERVER['MAPZEN_API_KEY']), $_SERVER['MAPZEN_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('242 Acklam Road, London, United Kingdom')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(51.521124, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-0.20360200000000001, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Acklam Road', $result->getStreetName()); @@ -87,12 +87,12 @@ public function testReverseWithRealCoordinates(): void $provider = new Mapzen($this->getHttpClient($_SERVER['MAPZEN_API_KEY']), $_SERVER['MAPZEN_API_KEY']); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(54.0484068, -2.7990345)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(54.048411999999999, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(-2.7989549999999999, $result->getCoordinates()->getLongitude(), 0.001); $this->assertNull($result->getStreetNumber()); @@ -115,12 +115,12 @@ public function testReverseWithVillage(): void $provider = new Mapzen($this->getHttpClient($_SERVER['MAPZEN_API_KEY']), $_SERVER['MAPZEN_API_KEY']); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(49.1390924, 1.6572462)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('Bus-Saint-Rémy', $result->getLocality()); } @@ -133,12 +133,12 @@ public function testGeocodeWithCity(): void $provider = new Mapzen($this->getHttpClient($_SERVER['MAPZEN_API_KEY']), $_SERVER['MAPZEN_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('Hanover')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(42.027323000000003, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-88.204203000000007, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNull($result->getLocality()); @@ -149,7 +149,7 @@ public function testGeocodeWithCity(): void /** @var \Geocoder\Model\Address $result */ $result = $results->get(1); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(18.393428, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-78.122906, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNull($result->getLocality()); @@ -159,7 +159,7 @@ public function testGeocodeWithCity(): void /** @var \Geocoder\Model\Address $result */ $result = $results->get(2); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(39.192889999999998, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-76.724140000000006, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Hanover', $result->getLocality()); @@ -177,12 +177,12 @@ public function testGeocodeWithCityDistrict(): void $provider = new Mapzen($this->getHttpClient($_SERVER['MAPZEN_API_KEY']), $_SERVER['MAPZEN_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('Kalbacher Hauptstraße 10, 60437 Frankfurt, Germany')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(2, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(50.189017, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(8.6367809999999992, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('10a', $result->getStreetNumber()); diff --git a/src/Provider/Mapzen/composer.json b/src/Provider/Mapzen/composer.json index fe22605fe..b67b7c2e9 100644 --- a/src/Provider/Mapzen/composer.json +++ b/src/Provider/Mapzen/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/MaxMind/CHANGELOG.md b/src/Provider/MaxMind/CHANGELOG.md index adf684540..bb890a4ae 100644 --- a/src/Provider/MaxMind/CHANGELOG.md +++ b/src/Provider/MaxMind/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.5.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 4.4.0 ### Added diff --git a/src/Provider/MaxMind/Tests/MaxMindTest.php b/src/Provider/MaxMind/Tests/MaxMindTest.php index 2a3e7b416..9b796932f 100644 --- a/src/Provider/MaxMind/Tests/MaxMindTest.php +++ b/src/Provider/MaxMind/Tests/MaxMindTest.php @@ -46,12 +46,12 @@ public function testGeocodeWithLocalhostIPv4(): void $provider = new MaxMind($this->getMockedHttpClient(), 'api_key'); $results = $provider->geocodeQuery(GeocodeQuery::create('127.0.0.1')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('localhost', $result->getLocality()); $this->assertEquals('localhost', $result->getCountry()->getName()); } @@ -61,12 +61,12 @@ public function testGeocodeWithLocalhostIPv6(): void $provider = new MaxMind($this->getMockedHttpClient(), 'api_key'); $results = $provider->geocodeQuery(GeocodeQuery::create('::1')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('localhost', $result->getLocality()); $this->assertEquals('localhost', $result->getCountry()->getName()); } @@ -94,12 +94,12 @@ public function testGeocodeWithRealIPv4GetsFakeContentFormattedEmpty(): void $provider = new MaxMind($this->getMockedHttpClient(',,,,,,,,,'), 'api_key'); $results = $provider->geocodeQuery(GeocodeQuery::create('74.200.247.59')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertNull($result->getCoordinates()); $this->assertNull($result->getStreetNumber()); @@ -119,12 +119,12 @@ public function testGeocodeWithRealIPv4GetsFakeContent(): void ), 'api_key'); $results = $provider->geocodeQuery(GeocodeQuery::create('74.200.247.59')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(33.034698486328, $result->getCoordinates()->getLatitude(), 0.0001); $this->assertEqualsWithDelta(-96.813400268555, $result->getCoordinates()->getLongitude(), 0.0001); $this->assertNull($result->getStreetNumber()); @@ -151,12 +151,12 @@ public function testGeocodeWithRealIPv4GetsFakeContent(): void ), 'api_key'); $results = $provider4->geocodeQuery(GeocodeQuery::create('74.200.247.59')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(37.748402, $result->getCoordinates()->getLatitude(), 0.0001); $this->assertEqualsWithDelta(-122.415604, $result->getCoordinates()->getLongitude(), 0.0001); $this->assertNull($result->getStreetNumber()); @@ -263,12 +263,12 @@ public function testGeocodeServiceWithRealIPv4(): void $provider = new MaxMind($this->getHttpClient($_SERVER['MAXMIND_API_KEY']), $_SERVER['MAXMIND_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('74.200.247.159')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(33.034698, $result->getCoordinates()->getLatitude(), 0.1); $this->assertEqualsWithDelta(-96.813400, $result->getCoordinates()->getLongitude(), 0.1); $this->assertNull($result->getBounds()); @@ -297,12 +297,12 @@ public function testGeocodeOmniServiceWithRealIPv4(): void ); $results = $provider->geocodeQuery(GeocodeQuery::create('74.200.247.159')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(33.0347, $result->getCoordinates()->getLatitude(), 0.1); $this->assertEqualsWithDelta(-96.8134, $result->getCoordinates()->getLongitude(), 0.1); $this->assertNull($result->getBounds()); @@ -332,12 +332,12 @@ public function testGeocodeOmniServiceWithRealIPv4WithSslAndEncoding(): void ); $results = $provider->geocodeQuery(GeocodeQuery::create('189.26.128.80')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(-27.5833, $result->getCoordinates()->getLatitude(), 0.1); $this->assertEqualsWithDelta(-48.5666, $result->getCoordinates()->getLongitude(), 0.1); $this->assertNull($result->getBounds()); @@ -367,12 +367,12 @@ public function testGeocodeOmniServiceWithRealIPv6WithSsl(): void ); $results = $provider->geocodeQuery(GeocodeQuery::create('2002:4293:f4d6:0:0:0:0:0')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(40.2181, $result->getCoordinates()->getLatitude(), 0.1); $this->assertEqualsWithDelta(-111.6133, $result->getCoordinates()->getLongitude(), 0.1); $this->assertNull($result->getBounds()); diff --git a/src/Provider/MaxMind/composer.json b/src/Provider/MaxMind/composer.json index 463cdb1c3..3551c1934 100644 --- a/src/Provider/MaxMind/composer.json +++ b/src/Provider/MaxMind/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "igorw/get-in": "^1.0", - "willdurand/geocoder": "^4.1" + "willdurand/geocoder": "^4.1|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/MaxMindBinary/CHANGELOG.md b/src/Provider/MaxMindBinary/CHANGELOG.md index 057fa7971..c145a903a 100644 --- a/src/Provider/MaxMindBinary/CHANGELOG.md +++ b/src/Provider/MaxMindBinary/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.4.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 4.3.1 ### Changed diff --git a/src/Provider/MaxMindBinary/Tests/MaxMindBinaryTest.php b/src/Provider/MaxMindBinary/Tests/MaxMindBinaryTest.php index af87f76a5..dca752eb9 100644 --- a/src/Provider/MaxMindBinary/Tests/MaxMindBinaryTest.php +++ b/src/Provider/MaxMindBinary/Tests/MaxMindBinaryTest.php @@ -68,12 +68,12 @@ public function testLocationResultContainsExpectedFieldsForAnAmericanIp(): void $provider = new MaxMindBinary($this->binaryFile); $results = $provider->geocodeQuery(GeocodeQuery::create('24.24.24.24')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(43.089200000000005, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(-76.025000000000006, $result->getCoordinates()->getLongitude(), 0.001); @@ -96,12 +96,12 @@ public function testLocationResultContainsExpectedFieldsForASpanishIp(): void $provider = new MaxMindBinary($this->binaryFile); $results = $provider->geocodeQuery(GeocodeQuery::create('80.24.24.24')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(41.543299999999988, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(2.1093999999999937, $result->getCoordinates()->getLongitude(), 0.001); @@ -127,12 +127,12 @@ public function testFindLocationByIp(string $ip, ?string $expectedCity, ?string $provider = new MaxMindBinary($this->binaryFile); $results = $provider->geocodeQuery(GeocodeQuery::create($ip)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals($expectedCity, $result->getLocality()); $this->assertEquals($expectedCountry, $result->getCountry()->getName()); } @@ -144,7 +144,7 @@ public function testShouldReturnResultsAsUtf8Encoded(): void /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertSame('Châlette-sur-loing', $result->getLocality()); } diff --git a/src/Provider/MaxMindBinary/composer.json b/src/Provider/MaxMindBinary/composer.json index e22175867..6b9adb2ae 100644 --- a/src/Provider/MaxMindBinary/composer.json +++ b/src/Provider/MaxMindBinary/composer.json @@ -15,7 +15,7 @@ "php": "^8.0", "geoip/geoip": "^1.17", "symfony/polyfill-mbstring": "^1.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/Nominatim/CHANGELOG.md b/src/Provider/Nominatim/CHANGELOG.md index 8f5cf645e..0e3b9e3a5 100644 --- a/src/Provider/Nominatim/CHANGELOG.md +++ b/src/Provider/Nominatim/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 5.8.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 5.7.0 ### Added diff --git a/src/Provider/Nominatim/Tests/NominatimTest.php b/src/Provider/Nominatim/Tests/NominatimTest.php index ee7e9eeb8..8a4db71fa 100644 --- a/src/Provider/Nominatim/Tests/NominatimTest.php +++ b/src/Provider/Nominatim/Tests/NominatimTest.php @@ -69,12 +69,12 @@ public function testGetNodeStreetName(): void $provider = Nominatim::withOpenStreetMapServer($this->getHttpClient(), 'Geocoder PHP/Nominatim Provider/Nominatim Test'); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(48.86, 2.35)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('Rue Quincampoix', $result->getStreetName()); } @@ -83,12 +83,12 @@ public function testGeocodeWithRealAddress(): void $provider = Nominatim::withOpenStreetMapServer($this->getHttpClient(), 'Geocoder PHP/Nominatim Provider/Nominatim Test'); $results = $provider->geocodeQuery(GeocodeQuery::create('1 Place des Palais 1000 bruxelles')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var \Geocoder\Provider\Nominatim\Model\NominatimAddress $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(50.8419916, $result->getCoordinates()->getLatitude(), 0.00001); $this->assertEqualsWithDelta(4.361988, $result->getCoordinates()->getLongitude(), 0.00001); $this->assertEquals('1', $result->getStreetNumber()); @@ -154,7 +154,7 @@ public function testGeocodeWithCountrycodes(): void $results = $provider->geocodeQuery($query); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertGreaterThanOrEqual(1, $results->count()); /** @var \Geocoder\Model\Address $result */ @@ -173,12 +173,12 @@ public function testGeocodeWithViewbox(): void $results = $provider->geocodeQuery($query); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var \Geocoder\Provider\Nominatim\Model\NominatimAddress $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(50.8419916, $result->getCoordinates()->getLatitude(), 0.00001); $this->assertEqualsWithDelta(4.361988, $result->getCoordinates()->getLongitude(), 0.00001); $this->assertEquals('1', $result->getStreetNumber()); @@ -201,12 +201,12 @@ public function testGeocodeNoOSMId(): void $provider = Nominatim::withOpenStreetMapServer($this->getHttpClient(), 'Geocoder PHP/Nominatim Provider/Nominatim Test'); $results = $provider->geocodeQuery(GeocodeQuery::create('90210,United States')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var \Geocoder\Provider\Nominatim\Model\NominatimAddress $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('90210', $result->getPostalCode()); $this->assertEquals('US', $result->getCountry()->getCode()); @@ -225,12 +225,12 @@ public function testGeocodeNoCountry(): void ->withData('bounded', true); $results = $provider->geocodeQuery($query); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var \Geocoder\Provider\Nominatim\Model\NominatimAddress $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright', $result->getAttribution()); $this->assertEquals('Italia', $result->getDisplayName()); @@ -245,12 +245,12 @@ public function testGeocodeNeighbourhood(): void $provider = Nominatim::withOpenStreetMapServer($this->getHttpClient(), 'Geocoder PHP/Nominatim Provider/Nominatim Test'); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(35.685939, 139.811695)->withLocale('en')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var \Geocoder\Provider\Nominatim\Model\NominatimAddress $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('Data © OpenStreetMap contributors, ODbL 1.0. https://osm.org/copyright', $result->getAttribution()); $this->assertEquals('Sarue 1-chome', $result->getNeighbourhood()); diff --git a/src/Provider/Nominatim/composer.json b/src/Provider/Nominatim/composer.json index 020600678..97fa34eeb 100644 --- a/src/Provider/Nominatim/composer.json +++ b/src/Provider/Nominatim/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.1", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/OpenCage/CHANGELOG.md b/src/Provider/OpenCage/CHANGELOG.md index 1d0e7c737..21614da7f 100644 --- a/src/Provider/OpenCage/CHANGELOG.md +++ b/src/Provider/OpenCage/CHANGELOG.md @@ -2,6 +2,23 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.8.0 + +### Added + +- Add support for PHP Geocoder 5 + +## 4.7.0 + +### Added + +- Add support for PHP 8.2, 8.3, and 8.4 +- Add support for confidence + +### Removed + +- Drop support for PHP 7.4 + ## 4.6.0 ### Added diff --git a/src/Provider/OpenCage/Model/OpenCageAddress.php b/src/Provider/OpenCage/Model/OpenCageAddress.php index 8c275ed2f..8ccad5145 100644 --- a/src/Provider/OpenCage/Model/OpenCageAddress.php +++ b/src/Provider/OpenCage/Model/OpenCageAddress.php @@ -49,6 +49,11 @@ final class OpenCageAddress extends Address */ private $formattedAddress; + /** + * @var int|null + */ + private $confidence; + public function withMGRS(?string $mgrs = null): self { $new = clone $this; @@ -128,4 +133,20 @@ public function getFormattedAddress() { return $this->formattedAddress; } + + public function withConfidence(?int $confidence = null): self + { + $new = clone $this; + $new->confidence = $confidence; + + return $new; + } + + /** + * @return int|null + */ + public function getConfidence() + { + return $this->confidence; + } } diff --git a/src/Provider/OpenCage/OpenCage.php b/src/Provider/OpenCage/OpenCage.php index e91b1c251..ddb665b0a 100644 --- a/src/Provider/OpenCage/OpenCage.php +++ b/src/Provider/OpenCage/OpenCage.php @@ -154,6 +154,7 @@ private function executeQuery(string $url, ?string $locale = null): AddressColle $address = $address->withGeohash(isset($annotations['geohash']) ? $annotations['geohash'] : null); $address = $address->withWhat3words(isset($annotations['what3words'], $annotations['what3words']['words']) ? $annotations['what3words']['words'] : null); $address = $address->withFormattedAddress($location['formatted']); + $address = $address->withConfidence($location['confidence']); $results[] = $address; } diff --git a/src/Provider/OpenCage/Tests/OpenCageTest.php b/src/Provider/OpenCage/Tests/OpenCageTest.php index 3a9a63449..acd91e2ac 100644 --- a/src/Provider/OpenCage/Tests/OpenCageTest.php +++ b/src/Provider/OpenCage/Tests/OpenCageTest.php @@ -83,6 +83,7 @@ public function testGeocodeWithRealAddress(): void $this->assertEquals('u09tyr78tz64jdcgfnhe', $result->getGeohash()); $this->assertEquals('listed.emphasis.greeting', $result->getWhat3words()); $this->assertEquals('10 Avenue Gambetta, 75020 Paris, France', $result->getFormattedAddress()); + $this->assertEquals(10, $result->getConfidence()); } public function testReverseWithRealCoordinates(): void diff --git a/src/Provider/OpenCage/composer.json b/src/Provider/OpenCage/composer.json index 4c4e1c561..752870d3d 100644 --- a/src/Provider/OpenCage/composer.json +++ b/src/Provider/OpenCage/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/OpenRouteService/CHANGELOG.md b/src/Provider/OpenRouteService/CHANGELOG.md index 78add6be9..3f1181c91 100644 --- a/src/Provider/OpenRouteService/CHANGELOG.md +++ b/src/Provider/OpenRouteService/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 1.4.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 1.3.0 ### Added diff --git a/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_2852fa5ac257c58d7f8f587eb758c32afd493773 b/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_2852fa5ac257c58d7f8f587eb758c32afd493773 index 731cf6dc2..d6cc6e525 100644 --- a/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_2852fa5ac257c58d7f8f587eb758c32afd493773 +++ b/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_2852fa5ac257c58d7f8f587eb758c32afd493773 @@ -1 +1 @@ -s:6375:"{"geocoding":{"version":"0.2","attribution":"http://192.168.2.20:3100/attribution","query":{"size":5,"private":false,"point.lat":49.1390924,"point.lon":1.6572462,"boundary.circle.lat":49.1390924,"boundary.circle.lon":1.6572462,"lang":{"name":"English","iso6391":"en","iso6393":"eng","defaulted":true},"querySize":10},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1571320064483},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[1.657246,49.139092]},"properties":{"id":"node/1564292039","gid":"openstreetmap:venue:node/1564292039","layer":"venue","source":"openstreetmap","source_id":"node/1564292039","name":"Les Jardins d'Épicure","confidence":1,"distance":0,"accuracy":"point","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"arrondissement of Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-en-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Les Jardins d'Épicure, Bray-et-Lû, France"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[1.657114,49.13946]},"properties":{"id":"fr/val_doise:1084c45fa72d54fa","gid":"openaddresses:address:fr/val_doise:1084c45fa72d54fa","layer":"address","source":"openaddresses","source_id":"fr/val_doise:1084c45fa72d54fa","name":"16 Grande Rue","housenumber":"16","street":"Grande Rue","confidence":0.8,"distance":0.042,"accuracy":"point","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"arrondissement of Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-en-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"16 Grande Rue, Bray-et-Lû, France"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[1.657682,49.139611]},"properties":{"id":"polyline:22476882","gid":"openstreetmap:street:polyline:22476882","layer":"street","source":"openstreetmap","source_id":"polyline:22476882","name":"Grande Rue","street":"Grande Rue","confidence":0.8,"distance":0.066,"accuracy":"centroid","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"arrondissement of Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-en-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Grande Rue, Bray-et-Lû, France"},"bbox":[1.656169,49.139324,1.65918,49.13993]},{"type":"Feature","geometry":{"type":"Point","coordinates":[1.658166,49.139008]},"properties":{"id":"fr/val_doise:9a64597420016413","gid":"openaddresses:address:fr/val_doise:9a64597420016413","layer":"address","source":"openaddresses","source_id":"fr/val_doise:9a64597420016413","name":"2 Rue Des Pres","housenumber":"2","street":"Rue Des Pres","confidence":0.8,"distance":0.068,"accuracy":"point","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"arrondissement of Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-en-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"2 Rue Des Pres, Bray-et-Lû, France"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[1.658165,49.139241]},"properties":{"id":"fr/val_doise:af72ea1457abb8e6","gid":"openaddresses:address:fr/val_doise:af72ea1457abb8e6","layer":"address","source":"openaddresses","source_id":"fr/val_doise:af72ea1457abb8e6","name":"3 Rue Des Pres","housenumber":"3","street":"Rue Des Pres","confidence":0.8,"distance":0.069,"accuracy":"point","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"arrondissement of Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-en-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"3 Rue Des Pres, Bray-et-Lû, France"}}],"bbox":[1.656169,49.139008,1.65918,49.13993]}"; \ No newline at end of file +s:6307:"{"geocoding":{"version":"0.2","attribution":"https://openrouteservice.org/terms-of-service/#attribution-geocode","query":{"size":5,"private":false,"point.lat":49.1390924,"point.lon":1.6572462,"boundary.circle.lat":49.1390924,"boundary.circle.lon":1.6572462,"lang":{"name":"English","iso6391":"en","iso6393":"eng","via":"default","defaulted":true},"querySize":10},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1742398940002},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[1.657246,49.139092]},"properties":{"id":"node/1564292039","gid":"openstreetmap:venue:node/1564292039","layer":"venue","source":"openstreetmap","source_id":"node/1564292039","name":"Les Jardins d'Épicure","confidence":1,"distance":0,"accuracy":"point","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-En-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Les Jardins d'Épicure, Bray-et-Lû, France"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[1.656323,49.139355]},"properties":{"id":"polyline:27466661","gid":"openstreetmap:street:polyline:27466661","layer":"street","source":"openstreetmap","source_id":"polyline:27466661","name":"Grande Rue","street":"Grande Rue","confidence":0.8,"distance":0.073,"accuracy":"centroid","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-En-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Grande Rue, Bray-et-Lû, France"},"bbox":[1.653428,49.138891,1.65918,49.139931]},{"type":"Feature","geometry":{"type":"Point","coordinates":[1.657561,49.139926]},"properties":{"id":"polyline:6138715","gid":"openstreetmap:street:polyline:6138715","layer":"street","source":"openstreetmap","source_id":"polyline:6138715","name":"Impasse du Square","street":"Impasse du Square","confidence":0.8,"distance":0.096,"accuracy":"centroid","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-En-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Impasse du Square, Bray-et-Lû, France"},"bbox":[1.657446,49.139626,1.65768,49.140226]},{"type":"Feature","geometry":{"type":"Point","coordinates":[1.655873,49.138949]},"properties":{"id":"polyline:6137636","gid":"openstreetmap:street:polyline:6137636","layer":"street","source":"openstreetmap","source_id":"polyline:6137636","name":"Impasse de l'Église","street":"Impasse de l'Église","confidence":0.7,"distance":0.101,"accuracy":"centroid","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-En-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Impasse de l'Église, Bray-et-Lû, France"},"bbox":[1.655817,49.138628,1.655926,49.13927]},{"type":"Feature","geometry":{"type":"Point","coordinates":[1.658245,49.139867]},"properties":{"id":"node/463219576","gid":"openstreetmap:venue:node/463219576","layer":"venue","source":"openstreetmap","source_id":"node/463219576","name":"Pharmacie de l'Epte","confidence":0.7,"distance":0.113,"accuracy":"point","country":"France","country_gid":"whosonfirst:country:85633147","country_a":"FRA","macroregion":"Ile-of-France","macroregion_gid":"whosonfirst:macroregion:404227465","macroregion_a":"IF","region":"Val-d'Oise","region_gid":"whosonfirst:region:85683451","region_a":"VO","macrocounty":"Pontoise","macrocounty_gid":"whosonfirst:macrocounty:404228193","county":"Magny-En-Vexin","county_gid":"whosonfirst:county:102067333","localadmin":"Bray-Et-Lu","localadmin_gid":"whosonfirst:localadmin:404408311","locality":"Bray-et-Lû","locality_gid":"whosonfirst:locality:1125876391","neighbourhood":"Bus-Saint-Rémy","neighbourhood_gid":"whosonfirst:neighbourhood:1360698119","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Pharmacie de l'Epte, Bray-et-Lû, France","addendum":{"osm":{"wheelchair":"yes"}}}}],"bbox":[1.653428,49.138628,1.65918,49.140226]}"; \ No newline at end of file diff --git a/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_40238ca9d898547616baa907da6fa485f5e96f87 b/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_40238ca9d898547616baa907da6fa485f5e96f87 index b6ce9c03a..73dd552de 100644 --- a/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_40238ca9d898547616baa907da6fa485f5e96f87 +++ b/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_40238ca9d898547616baa907da6fa485f5e96f87 @@ -1 +1 @@ -s:4534:"{"geocoding":{"version":"0.2","attribution":"http://192.168.2.20:3100/attribution","query":{"text":"Hanover","size":5,"layers":["venue","street","country","macroregion","region","county","localadmin","locality","borough","neighbourhood","continent","empire","dependency","macrocounty","macrohood","microhood","disputed","postalcode","ocean","marinearea"],"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","defaulted":true},"querySize":20,"parser":"libpostal","parsed_text":{"city":"hanover"}},"warnings":["performance optimization: excluding 'address' layer"],"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1571320064675},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[9.787455,52.379952]},"properties":{"id":"101748819","gid":"whosonfirst:locality:101748819","layer":"locality","source":"whosonfirst","source_id":"101748819","name":"Hanover","confidence":1,"match_type":"exact","accuracy":"centroid","country":"Germany","country_gid":"whosonfirst:country:85633111","country_a":"DEU","region":"Niedersachsen","region_gid":"whosonfirst:region:85682555","region_a":"NI","county":"Hannover ","county_gid":"whosonfirst:county:102063941","county_a":"HA","locality":"Hanover","locality_gid":"whosonfirst:locality:101748819","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Hanover, Germany"},"bbox":[9.6351335,52.3170855,9.8810641501,52.4482873275]},{"type":"Feature","geometry":{"type":"Point","coordinates":[9.73711,52.37362]},"properties":{"id":"1125331247","gid":"whosonfirst:localadmin:1125331247","layer":"localadmin","source":"whosonfirst","source_id":"1125331247","name":"Hanover","confidence":1,"match_type":"exact","accuracy":"centroid","country":"Germany","country_gid":"whosonfirst:country:85633111","country_a":"DEU","region":"Niedersachsen","region_gid":"whosonfirst:region:85682555","region_a":"NI","county":"Hannover ","county_gid":"whosonfirst:county:102063941","county_a":"HA","localadmin":"Hanover","localadmin_gid":"whosonfirst:localadmin:1125331247","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Hanover, Germany"},"bbox":[9.73711,52.37362,9.73711,52.37362]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-78.107687,18.401137]},"properties":{"id":"85672563","gid":"whosonfirst:region:85672563","layer":"region","source":"whosonfirst","source_id":"85672563","name":"Hanover","confidence":0.3,"match_type":"fallback","accuracy":"centroid","country":"Jamaica","country_gid":"whosonfirst:country:85632215","country_a":"JAM","region":"Hanover","region_gid":"whosonfirst:region:85672563","region_a":"HA","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Hanover, Jamaica"},"bbox":[-78.344668,18.307772,-77.909728,18.462863]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-76.72414,39.19289]},"properties":{"id":"1125874787","gid":"whosonfirst:locality:1125874787","layer":"locality","source":"whosonfirst","source_id":"1125874787","name":"Hanover","confidence":1,"match_type":"exact","accuracy":"centroid","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"Maryland","region_gid":"whosonfirst:region:85688501","region_a":"MD","county":"Howard County","county_gid":"whosonfirst:county:102084263","county_a":"HO","locality":"Hanover","locality_gid":"whosonfirst:locality:1125874787","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Hanover, MD, USA"},"bbox":[-76.72414,39.19289,-76.72414,39.19289]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-70.81199,42.11316]},"properties":{"id":"1125765125","gid":"whosonfirst:locality:1125765125","layer":"locality","source":"whosonfirst","source_id":"1125765125","name":"Hanover","confidence":1,"match_type":"exact","accuracy":"centroid","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"Massachusetts","region_gid":"whosonfirst:region:85688645","region_a":"MA","county":"Plymouth County","county_gid":"whosonfirst:county:102084367","county_a":"PL","localadmin":"Hanover","localadmin_gid":"whosonfirst:localadmin:404476511","locality":"Hanover","locality_gid":"whosonfirst:locality:1125765125","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Hanover, MA, USA"},"bbox":[-70.81199,42.11316,-70.81199,42.11316]}],"bbox":[-78.344668,18.307772,9.8810641501,52.4482873275]}"; \ No newline at end of file +s:4725:"{"geocoding":{"version":"0.2","attribution":"https://openrouteservice.org/terms-of-service/#attribution-geocode","query":{"text":"Hanover","size":5,"layers":["venue","street","country","macroregion","region","county","localadmin","locality","borough","neighbourhood","continent","empire","dependency","macrocounty","macrohood","microhood","disputed","postalcode","ocean","marinearea"],"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","via":"default","defaulted":true},"querySize":20,"parser":"libpostal","parsed_text":{"city":"hanover"}},"warnings":["performance optimization: excluding 'address' layer"],"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1742398940244},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[9.787455,52.379952]},"properties":{"id":"101748819","gid":"whosonfirst:locality:101748819","layer":"locality","source":"whosonfirst","source_id":"101748819","name":"Hanover","confidence":1,"match_type":"exact","accuracy":"centroid","country":"Germany","country_gid":"whosonfirst:country:85633111","country_a":"DEU","region":"Lower Saxony","region_gid":"whosonfirst:region:85682555","region_a":"NI","county":"Hannover","county_gid":"whosonfirst:county:102063941","county_a":"HA","localadmin":"Hannover","localadmin_gid":"whosonfirst:localadmin:1377686265","locality":"Hanover","locality_gid":"whosonfirst:locality:101748819","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Hanover, NI, Germany"},"bbox":[9.604728,52.305911,9.91856,52.453608]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-78.107687,18.401137]},"properties":{"id":"85672563","gid":"whosonfirst:region:85672563","layer":"region","source":"whosonfirst","source_id":"85672563","name":"Hanover","confidence":0.3,"match_type":"fallback","accuracy":"centroid","country":"Jamaica","country_gid":"whosonfirst:country:85632215","country_a":"JAM","region":"Hanover","region_gid":"whosonfirst:region:85672563","region_a":"HA","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Hanover, Jamaica"},"bbox":[-78.344668,18.307772,-77.909728,18.462863]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-76.72414,39.19289]},"properties":{"id":"1125874787","gid":"whosonfirst:locality:1125874787","layer":"locality","source":"whosonfirst","source_id":"1125874787","name":"Hanover","confidence":1,"match_type":"exact","accuracy":"centroid","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"Maryland","region_gid":"whosonfirst:region:85688501","region_a":"MD","county":"Howard County","county_gid":"whosonfirst:county:102084263","county_a":"HO","locality":"Hanover","locality_gid":"whosonfirst:locality:1125874787","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Hanover, MD, USA"},"bbox":[-76.74414,39.17289,-76.70414,39.21289]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-70.81199,42.11316]},"properties":{"id":"1125765125","gid":"whosonfirst:locality:1125765125","layer":"locality","source":"whosonfirst","source_id":"1125765125","name":"Hanover","confidence":1,"match_type":"exact","accuracy":"centroid","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"Massachusetts","region_gid":"whosonfirst:region:85688645","region_a":"MA","county":"Plymouth County","county_gid":"whosonfirst:county:102084367","county_a":"PL","localadmin":"Hanover","localadmin_gid":"whosonfirst:localadmin:404476511","locality":"Hanover","locality_gid":"whosonfirst:locality:1125765125","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Hanover, MA, USA"},"bbox":[-70.83199,42.09316,-70.79199,42.13316]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-76.983956,39.811775]},"properties":{"id":"101717245","gid":"whosonfirst:locality:101717245","layer":"locality","source":"whosonfirst","source_id":"101717245","name":"Hanover","confidence":1,"match_type":"exact","accuracy":"centroid","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"Pennsylvania","region_gid":"whosonfirst:region:85688481","region_a":"PA","county":"York County","county_gid":"whosonfirst:county:102080953","county_a":"YO","localadmin":"Hanover","localadmin_gid":"whosonfirst:localadmin:404487771","locality":"Hanover","locality_gid":"whosonfirst:locality:101717245","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Hanover, PA, USA"},"bbox":[-76.99965,39.791156,-76.963061,39.831769]}],"bbox":[-78.344668,18.307772,9.91856,52.453608]}"; \ No newline at end of file diff --git a/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_65c6b6dd290cf433627e7b6e72b6e3ae717356a1 b/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_65c6b6dd290cf433627e7b6e72b6e3ae717356a1 index f80d6b674..9c07f02bb 100644 --- a/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_65c6b6dd290cf433627e7b6e72b6e3ae717356a1 +++ b/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_65c6b6dd290cf433627e7b6e72b6e3ae717356a1 @@ -1 +1 @@ -s:1586:"{"geocoding":{"version":"0.2","attribution":"http://192.168.2.20:3100/attribution","query":{"text":"10 Downing St, London, UK","size":5,"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","defaulted":true},"querySize":20,"parser":"libpostal","parsed_text":{"number":"10","street":"downing st","city":"london","country":"uk"}},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1571320063378},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-0.127636,51.50328]},"properties":{"id":"relation/1879842","gid":"openstreetmap:address:relation/1879842","layer":"address","source":"openstreetmap","source_id":"relation/1879842","name":"10 Downing Street","housenumber":"10","street":"Downing Street","postalcode":"SW1A 2AA","confidence":1,"match_type":"exact","accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Greater London","region_gid":"whosonfirst:region:1360698645","locality":"London","locality_gid":"whosonfirst:locality:101750367","borough":"Westminster","borough_gid":"whosonfirst:borough:1158857245","neighbourhood":"Whitehall","neighbourhood_gid":"whosonfirst:neighbourhood:85793317","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"10 Downing Street, London, England, United Kingdom","addendum":{"osm":{"wikidata":"Q169101","wikipedia":"en:10 Downing Street"}}}}],"bbox":[-0.127636,51.50328,-0.127636,51.50328]}"; \ No newline at end of file +s:1737:"{"geocoding":{"version":"0.2","attribution":"https://openrouteservice.org/terms-of-service/#attribution-geocode","query":{"text":"10 Downing St, London, UK","size":5,"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","via":"default","defaulted":true},"querySize":20,"parser":"libpostal","parsed_text":{"housenumber":"10","street":"downing st","city":"london","country":"uk"}},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1742398939196},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-0.127611,51.503335]},"properties":{"id":"relation/1879842","gid":"openstreetmap:address:relation/1879842","layer":"address","source":"openstreetmap","source_id":"relation/1879842","name":"10 Downing Street","housenumber":"10","street":"Downing Street","postalcode":"SW1A 2AA","confidence":1,"match_type":"exact","accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Greater London","region_gid":"whosonfirst:region:1360698645","locality":"London","locality_gid":"whosonfirst:locality:101750367","borough":"Westminster","borough_gid":"whosonfirst:borough:1158857245","neighbourhood":"Whitehall","neighbourhood_gid":"whosonfirst:neighbourhood:85793317","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"10 Downing Street, London, England, United Kingdom","addendum":{"osm":{"wikidata":"Q169101","wikipedia":"en:10 Downing Street","website":"https://www.gov.uk/government/organisations/prime-ministers-office-10-downing-street"}}}}],"bbox":[-0.127611,51.503335,-0.127611,51.503335]}"; \ No newline at end of file diff --git a/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_6d63e36f25e65929745eafcd73d0ea36a038dad7 b/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_6d63e36f25e65929745eafcd73d0ea36a038dad7 index 8b66c2354..e2602c5ad 100644 --- a/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_6d63e36f25e65929745eafcd73d0ea36a038dad7 +++ b/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_6d63e36f25e65929745eafcd73d0ea36a038dad7 @@ -1 +1 @@ -s:5127:"{"geocoding":{"version":"0.2","attribution":"http://192.168.2.20:3100/attribution","query":{"size":5,"private":false,"point.lat":38.900206,"point.lon":-77.036991,"boundary.circle.lat":38.900206,"boundary.circle.lon":-77.036991,"lang":{"name":"English","iso6391":"en","iso6393":"eng","defaulted":true},"querySize":10},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1571320063874},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.0367,38.9003]},"properties":{"id":"6482379","gid":"geonames:venue:6482379","layer":"venue","source":"geonames","source_id":"6482379","name":"The Hay Adams across from the White House","confidence":0.8,"distance":0.027,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","county":"District of Columbia","county_gid":"whosonfirst:county:1377370667","county_a":"DI","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Downtown","neighbourhood_gid":"whosonfirst:neighbourhood:85866033","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"The Hay Adams across from the White House, Washington, DC, USA"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.0372,38.90039]},"properties":{"id":"4140517","gid":"geonames:venue:4140517","layer":"venue","source":"geonames","source_id":"4140517","name":"Slidell House (historical)","confidence":0.8,"distance":0.027,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","county":"District of Columbia","county_gid":"whosonfirst:county:1377370667","county_a":"DI","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Downtown","neighbourhood_gid":"whosonfirst:neighbourhood:85866033","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Slidell House (historical), Washington, DC, USA"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.03664,38.90011]},"properties":{"id":"4137678","gid":"geonames:venue:4137678","layer":"venue","source":"geonames","source_id":"4137678","name":"Bancroft House (historical)","confidence":0.8,"distance":0.032,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","county":"District of Columbia","county_gid":"whosonfirst:county:1377370667","county_a":"DI","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Lafayette Square","neighbourhood_gid":"whosonfirst:neighbourhood:1108724047","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Bancroft House (historical), Washington, DC, USA"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.036952,38.900522]},"properties":{"id":"way/55326891","gid":"openstreetmap:address:way/55326891","layer":"address","source":"openstreetmap","source_id":"way/55326891","name":"800 16th Street Northwest","housenumber":"800","street":"16th Street Northwest","postalcode":"20006","confidence":0.8,"distance":0.035,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","county":"District of Columbia","county_gid":"whosonfirst:county:1377370667","county_a":"DI","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Downtown","neighbourhood_gid":"whosonfirst:neighbourhood:85866033","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"800 16th Street Northwest, Washington, DC, USA","addendum":{"osm":{"wikidata":"Q11861763"}}}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.036952,38.900522]},"properties":{"id":"way/55326891","gid":"openstreetmap:venue:way/55326891","layer":"venue","source":"openstreetmap","source_id":"way/55326891","name":"Hay-Adams Hotel","housenumber":"800","street":"16th Street Northwest","postalcode":"20006","confidence":0.8,"distance":0.035,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","county":"District of Columbia","county_gid":"whosonfirst:county:1377370667","county_a":"DI","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Downtown","neighbourhood_gid":"whosonfirst:neighbourhood:85866033","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Hay-Adams Hotel, Washington, DC, USA","addendum":{"osm":{"wikidata":"Q11861763"}}},"bbox":[-77.0371738,38.9003173,-77.0367231,38.9006934]}],"bbox":[-77.0372,38.90011,-77.03664,38.9006934]}"; \ No newline at end of file +s:5410:"{"geocoding":{"version":"0.2","attribution":"https://openrouteservice.org/terms-of-service/#attribution-geocode","query":{"size":5,"private":false,"point.lat":38.900206,"point.lon":-77.036991,"boundary.circle.lat":38.900206,"boundary.circle.lon":-77.036991,"lang":{"name":"English","iso6391":"en","iso6393":"eng","via":"default","defaulted":true},"querySize":10},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1742398939496},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.0367,38.9003]},"properties":{"id":"6482379","gid":"geonames:venue:6482379","layer":"venue","source":"geonames","source_id":"6482379","name":"The Hay Adams across from the White House","confidence":0.8,"distance":0.027,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","county":"District of Columbia","county_gid":"whosonfirst:county:1377370667","county_a":"DI","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Downtown","neighbourhood_gid":"whosonfirst:neighbourhood:85866033","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"The Hay Adams across from the White House, Washington, DC, USA","addendum":{"geonames":{"feature_code":"HTL"}}}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.0372,38.90039]},"properties":{"id":"4140517","gid":"geonames:venue:4140517","layer":"venue","source":"geonames","source_id":"4140517","name":"Slidell House (historical)","confidence":0.8,"distance":0.027,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","county":"District of Columbia","county_gid":"whosonfirst:county:1377370667","county_a":"DI","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Downtown","neighbourhood_gid":"whosonfirst:neighbourhood:85866033","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Slidell House (historical), Washington, DC, USA","addendum":{"geonames":{"feature_code":"BLDG"}}}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.03664,38.90011]},"properties":{"id":"4137678","gid":"geonames:venue:4137678","layer":"venue","source":"geonames","source_id":"4137678","name":"Bancroft House (historical)","confidence":0.8,"distance":0.032,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","county":"District of Columbia","county_gid":"whosonfirst:county:1377370667","county_a":"DI","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Lafayette Square","neighbourhood_gid":"whosonfirst:neighbourhood:1108724047","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Bancroft House (historical), Washington, DC, USA","addendum":{"geonames":{"feature_code":"BLDG"}}}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.036945,38.900522]},"properties":{"id":"way/55326891","gid":"openstreetmap:venue:way/55326891","layer":"venue","source":"openstreetmap","source_id":"way/55326891","name":"Hay-Adams Hotel","housenumber":"800","street":"16th Street NW","postalcode":"20006","confidence":0.8,"distance":0.035,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","county":"District of Columbia","county_gid":"whosonfirst:county:1377370667","county_a":"DI","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Downtown","neighbourhood_gid":"whosonfirst:neighbourhood:85866033","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"Hay-Adams Hotel, Washington, DC, USA","addendum":{"osm":{"wikidata":"Q11861763","website":"https://www.hayadams.com/","phone":"202-638-6600"}}},"bbox":[-77.0371738,38.9003173,-77.0367231,38.9006934]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-77.036945,38.900522]},"properties":{"id":"way/55326891","gid":"openstreetmap:address:way/55326891","layer":"address","source":"openstreetmap","source_id":"way/55326891","name":"800 16th Street NW","housenumber":"800","street":"16th Street NW","postalcode":"20006","confidence":0.8,"distance":0.035,"accuracy":"point","country":"United States","country_gid":"whosonfirst:country:85633793","country_a":"USA","region":"District of Columbia","region_gid":"whosonfirst:region:85688741","region_a":"DC","county":"District of Columbia","county_gid":"whosonfirst:county:1377370667","county_a":"DI","locality":"Washington","locality_gid":"whosonfirst:locality:85931779","neighbourhood":"Downtown","neighbourhood_gid":"whosonfirst:neighbourhood:85866033","continent":"North America","continent_gid":"whosonfirst:continent:102191575","label":"800 16th Street NW, Washington, DC, USA","addendum":{"osm":{"wikidata":"Q11861763","website":"https://www.hayadams.com/","phone":"202-638-6600"}}}}],"bbox":[-77.0372,38.90011,-77.03664,38.9006934]}"; \ No newline at end of file diff --git a/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_894335d693a40d07a78d1835696d84e8c84e2419 b/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_894335d693a40d07a78d1835696d84e8c84e2419 index 80bcb2e13..ffdb25522 100644 --- a/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_894335d693a40d07a78d1835696d84e8c84e2419 +++ b/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_894335d693a40d07a78d1835696d84e8c84e2419 @@ -1 +1 @@ -s:1579:"{"geocoding":{"version":"0.2","attribution":"http://192.168.2.20:3100/attribution","query":{"text":"242 Acklam Road, London, United Kingdom","size":5,"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","defaulted":true},"querySize":20,"parser":"libpostal","parsed_text":{"number":"242","street":"acklam road","city":"london","country":"united kingdom"}},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1571320064084},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-0.2028,51.521334]},"properties":{"id":"way/526221246","gid":"openstreetmap:address:way/526221246","layer":"address","source":"openstreetmap","source_id":"way/526221246","name":"242 Acklam Road","housenumber":"242","street":"Acklam Road","postalcode":"W10 5JJ","confidence":1,"match_type":"exact","accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Greater London","region_gid":"whosonfirst:region:1360698645","locality":"London","locality_gid":"whosonfirst:locality:101750367","borough":"Kensington and Chelsea","borough_gid":"whosonfirst:borough:1158857317","neighbourhood":"North Kensington","neighbourhood_gid":"whosonfirst:neighbourhood:85789461","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"242 Acklam Road, London, England, United Kingdom","addendum":{"osm":{"wikidata":"Q7987154"}}}}],"bbox":[-0.2028,51.521334,-0.2028,51.521334]}"; \ No newline at end of file +s:1718:"{"geocoding":{"version":"0.2","attribution":"https://openrouteservice.org/terms-of-service/#attribution-geocode","query":{"text":"242 Acklam Road, London, United Kingdom","size":5,"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","via":"default","defaulted":true},"querySize":20,"parser":"libpostal","parsed_text":{"housenumber":"242","street":"acklam road","city":"london","country":"united kingdom"}},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1742398939660},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-0.202887,51.521315]},"properties":{"id":"way/526221246","gid":"openstreetmap:address:way/526221246","layer":"address","source":"openstreetmap","source_id":"way/526221246","name":"242 Acklam Road","housenumber":"242","street":"Acklam Road","postalcode":"W10 5JJ","confidence":1,"match_type":"exact","accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Greater London","region_gid":"whosonfirst:region:1360698645","locality":"London","locality_gid":"whosonfirst:locality:101750367","borough":"Kensington and Chelsea","borough_gid":"whosonfirst:borough:1158857317","neighbourhood":"North Kensington","neighbourhood_gid":"whosonfirst:neighbourhood:85789461","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"242 Acklam Road, London, England, United Kingdom","addendum":{"osm":{"wikidata":"Q7987154","wikipedia":"en:Westbourne Studios","website":"http://www.westbournestudios.com/"}}}}],"bbox":[-0.202887,51.521315,-0.202887,51.521315]}"; \ No newline at end of file diff --git a/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_95866f6596d9d58110747df278ad62043a53fccb b/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_95866f6596d9d58110747df278ad62043a53fccb index f59fb2239..c3be64b1a 100644 --- a/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_95866f6596d9d58110747df278ad62043a53fccb +++ b/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_95866f6596d9d58110747df278ad62043a53fccb @@ -1 +1 @@ -s:721:"{"geocoding":{"version":"0.2","attribution":"http://192.168.2.20:3100/attribution","query":{"text":"jsajhgsdkfjhsfkjhaldkadjaslgldasd","size":5,"layers":["venue","street","country","macroregion","region","county","localadmin","locality","borough","neighbourhood","continent","empire","dependency","macrocounty","macrohood","microhood","disputed","postalcode","ocean","marinearea"],"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","defaulted":true},"querySize":20,"parser":"addressit","parsed_text":{}},"warnings":["performance optimization: excluding 'address' layer"],"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1571320063658},"type":"FeatureCollection","features":[]}"; \ No newline at end of file +s:809:"{"geocoding":{"version":"0.2","attribution":"https://openrouteservice.org/terms-of-service/#attribution-geocode","query":{"text":"jsajhgsdkfjhsfkjhaldkadjaslgldasd","size":5,"layers":["venue","street","country","macroregion","region","county","localadmin","locality","borough","neighbourhood","continent","empire","dependency","macrocounty","macrohood","microhood","disputed","postalcode","ocean","marinearea"],"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","via":"default","defaulted":true},"querySize":20,"parser":"pelias","parsed_text":{"subject":"jsajhgsdkfjhsfkjhaldkadjaslgldasd"}},"warnings":["performance optimization: excluding 'address' layer"],"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1742398939331},"type":"FeatureCollection","features":[]}"; \ No newline at end of file diff --git a/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_a58413da25f17fd91174690b172feeccb250cca4 b/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_a58413da25f17fd91174690b172feeccb250cca4 index cb692e513..46aa8c9d7 100644 --- a/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_a58413da25f17fd91174690b172feeccb250cca4 +++ b/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_a58413da25f17fd91174690b172feeccb250cca4 @@ -1 +1 @@ -s:4991:"{"geocoding":{"version":"0.2","attribution":"http://192.168.2.20:3100/attribution","query":{"size":5,"private":false,"point.lat":54.0484068,"point.lon":-2.7990345,"boundary.circle.lat":54.0484068,"boundary.circle.lon":-2.7990345,"lang":{"name":"English","iso6391":"en","iso6393":"eng","defaulted":true},"querySize":10},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1571320064325},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.798964,54.04843]},"properties":{"id":"way/568787583","gid":"openstreetmap:address:way/568787583","layer":"address","source":"openstreetmap","source_id":"way/568787583","name":"1 Gage Street","housenumber":"1","street":"Gage Street","postalcode":"LA1 1UH","confidence":0.9,"distance":0.005,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:1360698567","county":"Lancashire","county_gid":"whosonfirst:county:1360698817","county_a":"LAN","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"1 Gage Street, Lancaster, England, United Kingdom"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.798964,54.04843]},"properties":{"id":"way/568787583","gid":"openstreetmap:venue:way/568787583","layer":"venue","source":"openstreetmap","source_id":"way/568787583","name":"Collegian W.M.C","housenumber":"1","street":"Gage Street","postalcode":"LA1 1UH","confidence":0.9,"distance":0.005,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:1360698567","county":"Lancashire","county_gid":"whosonfirst:county:1360698817","county_a":"LAN","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Collegian W.M.C, Lancaster, England, United Kingdom"},"bbox":[-2.7991111,54.0483534,-2.798818,54.0485068]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.79913,54.048378]},"properties":{"id":"node/3930587961","gid":"openstreetmap:venue:node/3930587961","layer":"venue","source":"openstreetmap","source_id":"node/3930587961","name":"Stable End Curio's","confidence":0.9,"distance":0.007,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:1360698567","county":"Lancashire","county_gid":"whosonfirst:county:1360698817","county_a":"LAN","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Stable End Curio's, Lancaster, England, United Kingdom"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.79931,54.048391]},"properties":{"id":"node/6592154385","gid":"openstreetmap:address:node/6592154385","layer":"address","source":"openstreetmap","source_id":"node/6592154385","name":"5-7 Ffrances Passage","housenumber":"5-7","street":"Ffrances Passage","postalcode":"LA1 1UG","confidence":0.8,"distance":0.018,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:1360698567","county":"Lancashire","county_gid":"whosonfirst:county:1360698817","county_a":"LAN","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"5-7 Ffrances Passage, Lancaster, England, United Kingdom"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.79931,54.048391]},"properties":{"id":"node/6592154385","gid":"openstreetmap:venue:node/6592154385","layer":"venue","source":"openstreetmap","source_id":"node/6592154385","name":"Diggles","housenumber":"5-7","street":"Ffrances Passage","postalcode":"LA1 1UG","confidence":0.8,"distance":0.018,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:1360698567","county":"Lancashire","county_gid":"whosonfirst:county:1360698817","county_a":"LAN","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Diggles, Lancaster, England, United Kingdom"}}],"bbox":[-2.79931,54.0483534,-2.798818,54.0485068]}"; \ No newline at end of file +s:5535:"{"geocoding":{"version":"0.2","attribution":"https://openrouteservice.org/terms-of-service/#attribution-geocode","query":{"size":5,"private":false,"point.lat":54.0484068,"point.lon":-2.7990345,"boundary.circle.lat":54.0484068,"boundary.circle.lon":-2.7990345,"lang":{"name":"English","iso6391":"en","iso6393":"eng","via":"default","defaulted":true},"querySize":10},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1742398939834},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.79913,54.048378]},"properties":{"id":"node/3930587961","gid":"openstreetmap:address:node/3930587961","layer":"address","source":"openstreetmap","source_id":"node/3930587961","name":"11 Ffrances Passage","housenumber":"11","street":"Ffrances Passage","postalcode":"LA1 1UG","confidence":0.9,"distance":0.007,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:1360698567","county":"Lancashire","county_gid":"whosonfirst:county:1360698817","county_a":"LAN","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"11 Ffrances Passage, Lancaster, England, United Kingdom","addendum":{"osm":{"website":"https://stableendcurios.co.uk/","opening_hours":"Mo-Fr 10:00-16:30; Sa 09:30-16:30"}}}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.79913,54.048378]},"properties":{"id":"node/3930587961","gid":"openstreetmap:venue:node/3930587961","layer":"venue","source":"openstreetmap","source_id":"node/3930587961","name":"Stable End Curios","housenumber":"11","street":"Ffrances Passage","postalcode":"LA1 1UG","confidence":0.9,"distance":0.007,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:1360698567","county":"Lancashire","county_gid":"whosonfirst:county:1360698817","county_a":"LAN","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Stable End Curios, Lancaster, England, United Kingdom","addendum":{"osm":{"website":"https://stableendcurios.co.uk/","opening_hours":"Mo-Fr 10:00-16:30; Sa 09:30-16:30"}}}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.798864,54.048381]},"properties":{"id":"way/568787583","gid":"openstreetmap:venue:way/568787583","layer":"venue","source":"openstreetmap","source_id":"way/568787583","name":"Collegian W.M.C","housenumber":"1","street":"Gage Street","postalcode":"LA1 1UH","confidence":0.8,"distance":0.012,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:1360698567","county":"Lancashire","county_gid":"whosonfirst:county:1360698817","county_a":"LAN","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Collegian W.M.C, Lancaster, England, United Kingdom"},"bbox":[-2.7991032,54.0483796,-2.7988259,54.0484971]},{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.798864,54.048381]},"properties":{"id":"way/568787583","gid":"openstreetmap:address:way/568787583","layer":"address","source":"openstreetmap","source_id":"way/568787583","name":"1 Gage Street","housenumber":"1","street":"Gage Street","postalcode":"LA1 1UH","confidence":0.8,"distance":0.012,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:1360698567","county":"Lancashire","county_gid":"whosonfirst:county:1360698817","county_a":"LAN","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"1 Gage Street, Lancaster, England, United Kingdom"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[-2.799226,54.048388]},"properties":{"id":"node/7972660790","gid":"openstreetmap:venue:node/7972660790","layer":"venue","source":"openstreetmap","source_id":"node/7972660790","name":"Evolve Tattoos","housenumber":"9","street":"Ffrances Passage","postalcode":"LA1 1UG","confidence":0.8,"distance":0.013,"accuracy":"point","country":"United Kingdom","country_gid":"whosonfirst:country:85633159","country_a":"GBR","macroregion":"England","macroregion_gid":"whosonfirst:macroregion:404227469","region":"Lancashire","region_gid":"whosonfirst:region:1360698567","county":"Lancashire","county_gid":"whosonfirst:county:1360698817","county_a":"LAN","locality":"Lancaster","locality_gid":"whosonfirst:locality:101873271","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Evolve Tattoos, Lancaster, England, United Kingdom","addendum":{"osm":{"website":"https://www.facebook.com/pages/category/Tattoo---Piercing-Shop/Evolve-Tattoo-and-Body-Arts-Studio-123157141032019/","opening_hours":"Tu-Sa 10:00-17:00"}}}}],"bbox":[-2.799226,54.048378,-2.7988259,54.0484971]}"; \ No newline at end of file diff --git a/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_dbef321627efcc45bf0d7463af0fd7dde4f7fda5 b/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_dbef321627efcc45bf0d7463af0fd7dde4f7fda5 index 76ca709aa..185314b37 100644 --- a/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_dbef321627efcc45bf0d7463af0fd7dde4f7fda5 +++ b/src/Provider/OpenRouteService/Tests/.cached_responses/api.openrouteservice.org_dbef321627efcc45bf0d7463af0fd7dde4f7fda5 @@ -1 +1 @@ -s:2831:"{"geocoding":{"version":"0.2","attribution":"http://192.168.2.20:3100/attribution","query":{"text":"Kalbacher Hauptstraße 10, 60437 Frankfurt, Germany","size":5,"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","defaulted":true},"querySize":20,"parser":"libpostal","parsed_text":{"street":"kalbacher hauptstraße","number":"10","postalcode":"60437","city":"frankfurt","country":"germany"}},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1571320065030},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[8.636781,50.189017]},"properties":{"id":"de/he/city_of_frankfurtammain:af1f19357b787d33","gid":"openaddresses:address:de/he/city_of_frankfurtammain:af1f19357b787d33","layer":"address","source":"openaddresses","source_id":"de/he/city_of_frankfurtammain:af1f19357b787d33","name":"Kalbacher Hauptstraße 10a","housenumber":"10a","street":"Kalbacher Hauptstraße","postalcode":"60437","confidence":1,"match_type":"exact","accuracy":"point","country":"Germany","country_gid":"whosonfirst:country:85633111","country_a":"DEU","region":"Hessen","region_gid":"whosonfirst:region:85682531","region_a":"HE","macrocounty":"Darmstadt Government Region","macrocounty_gid":"whosonfirst:macrocounty:404227581","county":"Frankfurt","county_gid":"whosonfirst:county:102063589","county_a":"FA","locality":"Frankfurt","locality_gid":"whosonfirst:locality:101913837","neighbourhood":"Römerstadt","neighbourhood_gid":"whosonfirst:neighbourhood:85796311","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Kalbacher Hauptstraße 10a, Frankfurt, Germany"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[8.636575,50.189044]},"properties":{"id":"de/he/city_of_frankfurtammain:f0bbbc440fb8b4b9","gid":"openaddresses:address:de/he/city_of_frankfurtammain:f0bbbc440fb8b4b9","layer":"address","source":"openaddresses","source_id":"de/he/city_of_frankfurtammain:f0bbbc440fb8b4b9","name":"Kalbacher Hauptstraße 10","housenumber":"10","street":"Kalbacher Hauptstraße","postalcode":"60437","confidence":1,"match_type":"exact","accuracy":"point","country":"Germany","country_gid":"whosonfirst:country:85633111","country_a":"DEU","region":"Hessen","region_gid":"whosonfirst:region:85682531","region_a":"HE","macrocounty":"Darmstadt Government Region","macrocounty_gid":"whosonfirst:macrocounty:404227581","county":"Frankfurt","county_gid":"whosonfirst:county:102063589","county_a":"FA","locality":"Frankfurt","locality_gid":"whosonfirst:locality:101913837","neighbourhood":"Römerstadt","neighbourhood_gid":"whosonfirst:neighbourhood:85796311","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Kalbacher Hauptstraße 10, Frankfurt, Germany"}}],"bbox":[8.636575,50.189017,8.636781,50.189044]}"; \ No newline at end of file +s:2860:"{"geocoding":{"version":"0.2","attribution":"https://openrouteservice.org/terms-of-service/#attribution-geocode","query":{"text":"Kalbacher Hauptstraße 10, 60437 Frankfurt, Germany","size":5,"private":false,"lang":{"name":"English","iso6391":"en","iso6393":"eng","via":"default","defaulted":true},"querySize":20,"parser":"libpostal","parsed_text":{"street":"kalbacher hauptstraße","housenumber":"10","postalcode":"60437","city":"frankfurt","country":"germany"}},"engine":{"name":"Pelias","author":"Mapzen","version":"1.0"},"timestamp":1742398940428},"type":"FeatureCollection","features":[{"type":"Feature","geometry":{"type":"Point","coordinates":[8.636816,50.189008]},"properties":{"id":"way/315515483","gid":"openstreetmap:address:way/315515483","layer":"address","source":"openstreetmap","source_id":"way/315515483","name":"Kalbacher Hauptstraße 10a","housenumber":"10a","street":"Kalbacher Hauptstraße","postalcode":"60437","confidence":1,"match_type":"exact","accuracy":"point","country":"Germany","country_gid":"whosonfirst:country:85633111","country_a":"DEU","region":"Hesse","region_gid":"whosonfirst:region:85682531","region_a":"HE","macrocounty":"Darmstadt Government Region","macrocounty_gid":"whosonfirst:macrocounty:404227581","county":"Frankfurt","county_gid":"whosonfirst:county:102063589","county_a":"FA","localadmin":"Frankfurt am Main","localadmin_gid":"whosonfirst:localadmin:1377692799","locality":"Frankfurt","locality_gid":"whosonfirst:locality:101913837","neighbourhood":"Römerstadt","neighbourhood_gid":"whosonfirst:neighbourhood:85796311","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Kalbacher Hauptstraße 10a, Frankfurt, HE, Germany"}},{"type":"Feature","geometry":{"type":"Point","coordinates":[8.63661,50.189046]},"properties":{"id":"way/109282123","gid":"openstreetmap:address:way/109282123","layer":"address","source":"openstreetmap","source_id":"way/109282123","name":"Kalbacher Hauptstraße 10","housenumber":"10","street":"Kalbacher Hauptstraße","postalcode":"60437","confidence":1,"match_type":"exact","accuracy":"point","country":"Germany","country_gid":"whosonfirst:country:85633111","country_a":"DEU","region":"Hesse","region_gid":"whosonfirst:region:85682531","region_a":"HE","macrocounty":"Darmstadt Government Region","macrocounty_gid":"whosonfirst:macrocounty:404227581","county":"Frankfurt","county_gid":"whosonfirst:county:102063589","county_a":"FA","localadmin":"Frankfurt am Main","localadmin_gid":"whosonfirst:localadmin:1377692799","locality":"Frankfurt","locality_gid":"whosonfirst:locality:101913837","neighbourhood":"Römerstadt","neighbourhood_gid":"whosonfirst:neighbourhood:85796311","continent":"Europe","continent_gid":"whosonfirst:continent:102191581","label":"Kalbacher Hauptstraße 10, Frankfurt, HE, Germany"}}],"bbox":[8.63661,50.189008,8.636816,50.189046]}"; \ No newline at end of file diff --git a/src/Provider/OpenRouteService/Tests/OpenRouteServiceTest.php b/src/Provider/OpenRouteService/Tests/OpenRouteServiceTest.php index 938794b7e..d06fb457a 100644 --- a/src/Provider/OpenRouteService/Tests/OpenRouteServiceTest.php +++ b/src/Provider/OpenRouteService/Tests/OpenRouteServiceTest.php @@ -49,12 +49,12 @@ public function testGeocodeWithRealAddress(): void $provider = new OpenRouteService($this->getHttpClient($_SERVER['OPEN_ROUTE_SERVICE_API_KEY']), $_SERVER['OPEN_ROUTE_SERVICE_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('242 Acklam Road, London, United Kingdom')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(51.521124, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-0.20360200000000001, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Acklam Road', $result->getStreetName()); @@ -74,21 +74,21 @@ public function testReverseWithRealCoordinates(): void $provider = new OpenRouteService($this->getHttpClient($_SERVER['OPEN_ROUTE_SERVICE_API_KEY']), $_SERVER['OPEN_ROUTE_SERVICE_API_KEY']); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(54.0484068, -2.7990345)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(54.048411999999999, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(-2.7989549999999999, $result->getCoordinates()->getLongitude(), 0.001); - $this->assertEquals(1, $result->getStreetNumber()); - $this->assertEquals('Gage Street', $result->getStreetName()); - $this->assertEquals('LA1 1UH', $result->getPostalCode()); + $this->assertEquals(11, $result->getStreetNumber()); + $this->assertEquals('Ffrances Passage', $result->getStreetName()); + $this->assertEquals('LA1 1UG', $result->getPostalCode()); $this->assertEquals('Lancaster', $result->getLocality()); - $this->assertCount(5, $result->getAdminLevels()); - $this->assertEquals('Lancashire', $result->getAdminLevels()->get(1)->getName()); - $this->assertEquals('England', $result->getAdminLevels()->get(4)->getName()); + $this->assertCount(4, $result->getAdminLevels()); + $this->assertEquals('Lancashire', $result->getAdminLevels()->get(3)->getName()); + $this->assertEquals('England', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('United Kingdom', $result->getCountry()->getName()); $this->assertEquals('GBR', $result->getCountry()->getCode()); } @@ -102,12 +102,12 @@ public function testReverseWithVillage(): void $provider = new OpenRouteService($this->getHttpClient($_SERVER['OPEN_ROUTE_SERVICE_API_KEY']), $_SERVER['OPEN_ROUTE_SERVICE_API_KEY']); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(49.1390924, 1.6572462)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('Bray-et-Lû', $result->getLocality()); } @@ -120,46 +120,37 @@ public function testGeocodeWithCity(): void $provider = new OpenRouteService($this->getHttpClient($_SERVER['OPEN_ROUTE_SERVICE_API_KEY']), $_SERVER['OPEN_ROUTE_SERVICE_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('Hanover')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(52.379952, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(9.787455, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Hanover', $result->getLocality()); $this->assertCount(4, $result->getAdminLevels()); - $this->assertEquals('Niedersachsen', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('Lower Saxony', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Hanover', $result->getAdminLevels()->get(3)->getName()); $this->assertEquals('Germany', $result->getCountry()->getName()); /** @var \Geocoder\Model\Address $result */ $result = $results->get(1); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); - $this->assertEqualsWithDelta(52.37362, $result->getCoordinates()->getLatitude(), 0.01); - $this->assertEqualsWithDelta(9.73711, $result->getCoordinates()->getLongitude(), 0.01); - $this->assertCount(3, $result->getAdminLevels()); - $this->assertEquals('Niedersachsen', $result->getAdminLevels()->get(1)->getName()); - $this->assertEquals('Germany', $result->getCountry()->getName()); - - /** @var \Geocoder\Model\Address $result */ - $result = $results->get(2); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(18.393428, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-78.107687, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNull($result->getLocality()); - $this->assertCount(2, $result->getAdminLevels()); + $this->assertCount(1, $result->getAdminLevels()); $this->assertEquals('Hanover', $result->getAdminLevels()->get(1)->getName()); $this->assertEquals('Jamaica', $result->getCountry()->getName()); /** @var \Geocoder\Model\Address $result */ - $result = $results->get(3); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $result = $results->get(2); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(39.192889999999998, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-76.724140000000006, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('Hanover', $result->getLocality()); - $this->assertCount(4, $result->getAdminLevels()); + $this->assertCount(3, $result->getAdminLevels()); $this->assertEquals('Hanover', $result->getAdminLevels()->get(3)->getName()); $this->assertEquals('United States', $result->getCountry()->getName()); } @@ -173,22 +164,22 @@ public function testGeocodeWithCityDistrict(): void $provider = new OpenRouteService($this->getHttpClient($_SERVER['OPEN_ROUTE_SERVICE_API_KEY']), $_SERVER['OPEN_ROUTE_SERVICE_API_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('Kalbacher Hauptstraße 10, 60437 Frankfurt, Germany')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(2, $results); /** @var \Geocoder\Model\Address $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(50.189017, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(8.6367809999999992, $result->getCoordinates()->getLongitude(), 0.01); $this->assertEquals('10a', $result->getStreetNumber()); $this->assertEquals('Kalbacher Hauptstraße', $result->getStreetName()); $this->assertEquals(60437, $result->getPostalCode()); $this->assertEquals('Frankfurt', $result->getLocality()); - $this->assertCount(4, $result->getAdminLevels()); - $this->assertEquals('Frankfurt', $result->getAdminLevels()->get(2)->getName()); - $this->assertEquals('Hessen', $result->getAdminLevels()->get(1)->getName()); - $this->assertNull($result->getAdminLevels()->get(1)->getCode()); + $this->assertCount(5, $result->getAdminLevels()); + $this->assertEquals('Frankfurt', $result->getAdminLevels()->get(4)->getName()); + $this->assertEquals('Hesse', $result->getAdminLevels()->get(1)->getName()); + $this->assertEquals('HE', $result->getAdminLevels()->get(1)->getCode()); $this->assertEquals('Germany', $result->getCountry()->getName()); $this->assertEquals('DEU', $result->getCountry()->getCode()); } diff --git a/src/Provider/OpenRouteService/composer.json b/src/Provider/OpenRouteService/composer.json index 5cb1a73c3..947fd0d53 100644 --- a/src/Provider/OpenRouteService/composer.json +++ b/src/Provider/OpenRouteService/composer.json @@ -14,7 +14,7 @@ "php": "^8.0", "geocoder-php/common-http": "^4.0", "geocoder-php/pelias-provider": "^1.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/Pelias/CHANGELOG.md b/src/Provider/Pelias/CHANGELOG.md index 0ae88d80a..c92952b0f 100644 --- a/src/Provider/Pelias/CHANGELOG.md +++ b/src/Provider/Pelias/CHANGELOG.md @@ -2,6 +2,27 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 1.6.1 + +### Fixed + +- Fix nullable properties + +## 1.6.0 + +### Added + +- Add support for `id`, `layer`, `source`, `name`, `confidence`, and `accuracy` fields +- Add support for locale +- Add support for `layers` and `boundary.country` filters +- Improve extraction of admin levels + +## 1.5.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 1.4.0 ### Added diff --git a/src/Provider/Pelias/Model/PeliasAddress.php b/src/Provider/Pelias/Model/PeliasAddress.php new file mode 100644 index 000000000..14beb71f5 --- /dev/null +++ b/src/Provider/Pelias/Model/PeliasAddress.php @@ -0,0 +1,129 @@ + + */ +final class PeliasAddress extends Address +{ + /** + * @var string|null + */ + private $id; + + /** + * @var string|null + */ + private $layer; + + /** + * @var string|null + */ + private $source; + + /** + * @var string|null + */ + private $name; + + /** + * @var float|null + */ + private $confidence; + + /** + * @var string|null + */ + private $accuracy; + + public function getId(): ?string + { + return $this->id; + } + + public function withId(?string $id): self + { + $new = clone $this; + $new->id = $id; + + return $new; + } + + public function getSource(): ?string + { + return $this->source; + } + + public function withSource(?string $source): self + { + $new = clone $this; + $new->source = $source; + + return $new; + } + + public function getLayer(): ?string + { + return $this->layer; + } + + public function withLayer(?string $layer): self + { + $new = clone $this; + $new->layer = $layer; + + return $new; + } + + public function getName(): ?string + { + return $this->name; + } + + public function withName(?string $name): self + { + $new = clone $this; + $new->name = $name; + + return $new; + } + + public function getConfidence(): ?float + { + return $this->confidence; + } + + public function withConfidence(?float $confidence): self + { + $new = clone $this; + $new->confidence = $confidence; + + return $new; + } + + public function getAccuracy(): ?string + { + return $this->accuracy; + } + + public function withAccuracy(?string $accuracy): self + { + $new = clone $this; + $new->accuracy = $accuracy; + + return $new; + } +} diff --git a/src/Provider/Pelias/Pelias.php b/src/Provider/Pelias/Pelias.php index 3bf9a79cb..bb55a95d3 100644 --- a/src/Provider/Pelias/Pelias.php +++ b/src/Provider/Pelias/Pelias.php @@ -17,8 +17,9 @@ use Geocoder\Exception\QuotaExceeded; use Geocoder\Exception\UnsupportedOperation; use Geocoder\Http\Provider\AbstractHttpProvider; -use Geocoder\Model\Address; +use Geocoder\Model\AddressBuilder; use Geocoder\Model\AddressCollection; +use Geocoder\Provider\Pelias\Model\PeliasAddress; use Geocoder\Provider\Provider; use Geocoder\Query\GeocodeQuery; use Geocoder\Query\ReverseQuery; @@ -60,6 +61,8 @@ protected function getGeocodeQueryUrl(GeocodeQuery $query, array $query_data = [ $data = [ 'text' => $address, 'size' => $query->getLimit(), + 'layers' => null !== $query->getData('layers') ? implode(',', $query->getData('layers')) : null, + 'boundary.country' => null !== $query->getData('boundary.country') ? implode(',', $query->getData('boundary.country')) : null, ]; return sprintf('%s/search?%s', $this->root, http_build_query(array_merge($data, $query_data))); @@ -67,7 +70,7 @@ protected function getGeocodeQueryUrl(GeocodeQuery $query, array $query_data = [ public function geocodeQuery(GeocodeQuery $query): Collection { - return $this->executeQuery($this->getGeocodeQueryUrl($query)); + return $this->executeQuery($this->getGeocodeQueryUrl($query), $query->getLocale()); } /** @@ -85,6 +88,8 @@ protected function getReverseQueryUrl(ReverseQuery $query, array $query_data = [ 'point.lat' => $latitude, 'point.lon' => $longitude, 'size' => $query->getLimit(), + 'layers' => null !== $query->getData('layers') ? implode(',', $query->getData('layers')) : null, + 'boundary.country' => null !== $query->getData('boundary.country') ? implode(',', $query->getData('boundary.country')) : null, ]; return sprintf('%s/reverse?%s', $this->root, http_build_query(array_merge($data, $query_data))); @@ -92,7 +97,7 @@ protected function getReverseQueryUrl(ReverseQuery $query, array $query_data = [ public function reverseQuery(ReverseQuery $query): Collection { - return $this->executeQuery($this->getReverseQueryUrl($query)); + return $this->executeQuery($this->getReverseQueryUrl($query), $query->getLocale()); } public function getName(): string @@ -100,9 +105,15 @@ public function getName(): string return 'pelias'; } - protected function executeQuery(string $url): AddressCollection + protected function executeQuery(string $url, ?string $locale = null): AddressCollection { - $content = $this->getUrlContents($url); + $headers = []; + if (null !== $locale) { + $headers['Accept-Language'] = $locale; + } + + $request = $this->createRequest('GET', $url, $headers); + $content = $this->getParsedResponse($request); $json = json_decode($content, true); if (isset($json['meta'])) { @@ -124,53 +135,53 @@ protected function executeQuery(string $url): AddressCollection return new AddressCollection([]); } - $locations = $json['features']; + $features = $json['features']; - if (empty($locations)) { + if (empty($features)) { return new AddressCollection([]); } $results = []; - foreach ($locations as $location) { - if (isset($location['bbox'])) { - $bounds = [ - 'south' => $location['bbox'][3], - 'west' => $location['bbox'][2], - 'north' => $location['bbox'][1], - 'east' => $location['bbox'][0], - ]; - } else { - $bounds = [ - 'south' => null, - 'west' => null, - 'north' => null, - 'east' => null, - ]; + foreach ($features as $feature) { + $builder = new AddressBuilder($this->getName()); + $builder->setCoordinates($feature['geometry']['coordinates'][1], $feature['geometry']['coordinates'][0]); + $builder->setStreetNumber($feature['properties']['housenumber'] ?? null); + $builder->setStreetName($this->guessStreetName($feature['properties'])); + $builder->setSubLocality($this->guessSubLocality($feature['properties'])); + $builder->setLocality($this->guessLocality($feature['properties'])); + $builder->setPostalCode($feature['properties']['postalcode'] ?? null); + $builder->setCountry($feature['properties']['country'] ?? null); + $builder->setCountryCode( + isset($feature['properties']['country_code']) ? strtoupper($feature['properties']['country_code']) : + (isset($feature['properties']['country_a']) ? strtoupper($feature['properties']['country_a']) : null)); + $builder->setTimezone($feature['properties']['timezone'] ?? null); + + if (isset($feature['bbox'])) { + $builder->setBounds($feature['bbox'][3], $feature['bbox'][2], $feature['bbox'][1], $feature['bbox'][0]); } - $props = $location['properties']; - - $adminLevels = []; - foreach (['region', 'county', 'locality', 'macroregion', 'country'] as $i => $component) { - if (isset($props[$component])) { - $adminLevels[] = ['name' => $props[$component], 'level' => $i + 1]; + $level = 1; + foreach (['macroregion', 'region', 'macrocounty', 'county', 'locality', 'localadmin', 'borough'] as $component) { + if (isset($feature['properties'][$component])) { + $builder->addAdminLevel($level++, $feature['properties'][$component], $feature['properties'][$component.'_a'] ?? null); + } + // Administrative level should be an integer in [1,5]. + if ($level > 5) { + break; } } - $results[] = Address::createFromArray([ - 'providedBy' => $this->getName(), - 'latitude' => $location['geometry']['coordinates'][1], - 'longitude' => $location['geometry']['coordinates'][0], - 'bounds' => $bounds, - 'streetNumber' => isset($props['housenumber']) ? $props['housenumber'] : null, - 'streetName' => isset($props['street']) ? $props['street'] : null, - 'subLocality' => isset($props['neighbourhood']) ? $props['neighbourhood'] : null, - 'locality' => isset($props['locality']) ? $props['locality'] : null, - 'postalCode' => isset($props['postalcode']) ? $props['postalcode'] : null, - 'adminLevels' => $adminLevels, - 'country' => isset($props['country']) ? $props['country'] : null, - 'countryCode' => isset($props['country_a']) ? strtoupper($props['country_a']) : null, - ]); + /** @var PeliasAddress $location */ + $location = $builder->build(PeliasAddress::class); + + $location = $location->withId($feature['properties']['id'] ?? null); + $location = $location->withLayer($feature['properties']['layer'] ?? null); + $location = $location->withSource($feature['properties']['source'] ?? null); + $location = $location->withName($feature['properties']['name'] ?? null); + $location = $location->withConfidence($feature['properties']['confidence'] ?? null); + $location = $location->withAccuracy($feature['properties']['accuracy'] ?? null); + + $results[] = $location; } return new AddressCollection($results); @@ -181,11 +192,11 @@ protected function executeQuery(string $url): AddressCollection * * @return string|null */ - protected function guessLocality(array $components) + protected static function guessLocality(array $components) { - $localityKeys = ['city', 'town', 'village', 'hamlet']; + $localityKeys = ['locality', 'localadmin', 'city', 'town', 'village', 'hamlet']; - return $this->guessBestComponent($components, $localityKeys); + return self::guessBestComponent($components, $localityKeys); } /** @@ -193,11 +204,11 @@ protected function guessLocality(array $components) * * @return string|null */ - protected function guessStreetName(array $components) + protected static function guessSubLocality(array $components) { - $streetNameKeys = ['road', 'street', 'street_name', 'residential']; + $subLocalityKeys = ['neighbourhood', 'city_district']; - return $this->guessBestComponent($components, $streetNameKeys); + return self::guessBestComponent($components, $subLocalityKeys); } /** @@ -205,11 +216,11 @@ protected function guessStreetName(array $components) * * @return string|null */ - protected function guessSubLocality(array $components) + protected static function guessStreetName(array $components) { - $subLocalityKeys = ['neighbourhood', 'city_district']; + $streetNameKeys = ['road', 'street', 'street_name', 'residential']; - return $this->guessBestComponent($components, $subLocalityKeys); + return self::guessBestComponent($components, $streetNameKeys); } /** @@ -218,7 +229,7 @@ protected function guessSubLocality(array $components) * * @return string|null */ - protected function guessBestComponent(array $components, array $keys) + protected static function guessBestComponent(array $components, array $keys) { foreach ($keys as $key) { if (isset($components[$key]) && !empty($components[$key])) { diff --git a/src/Provider/Pelias/composer.json b/src/Provider/Pelias/composer.json index ee62bce41..aea3c6971 100644 --- a/src/Provider/Pelias/composer.json +++ b/src/Provider/Pelias/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/Photon/CHANGELOG.md b/src/Provider/Photon/CHANGELOG.md index 1a82c22d0..2162715df 100644 --- a/src/Provider/Photon/CHANGELOG.md +++ b/src/Provider/Photon/CHANGELOG.md @@ -2,6 +2,43 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 0.11.0 + +### Added + +- Add support for PHP Geocoder 5 + +## 0.10.0 + +### Added + +- Add support for multiple `layer` parameters + +## 0.9.0 + +### Added + +- Add support for `lat`, `lon` parameters +- Add support for `bbox` parameter + +## 0.8.0 + +### Added + +- Add support for `layer` and `radius` parameters +- Improve locality extraction + +## 0.7.0 + +### Added + +- Add support for PHP 8.3 and 8.4 +- Add support for OpenStreetMap filters + +### Removed + +- Drop support for PHP 7.3 + ## 0.6.0 ### Added diff --git a/src/Provider/Photon/Model/PhotonAddress.php b/src/Provider/Photon/Model/PhotonAddress.php index 033008849..049b2c706 100644 --- a/src/Provider/Photon/Model/PhotonAddress.php +++ b/src/Provider/Photon/Model/PhotonAddress.php @@ -54,6 +54,21 @@ final class PhotonAddress extends Address */ private $district; + /** + * @var string|null + */ + private $type; + + public function getLocality(): ?string + { + $locality = parent::getLocality(); + if (null === $locality && 'city' === $this->type && null !== $this->name) { + $locality = $this->name; + } + + return $locality; + } + /** * @return string|null */ @@ -173,4 +188,17 @@ public function withDistrict(?string $district = null): self return $new; } + + public function getType(): ?string + { + return $this->type; + } + + public function withType(?string $type = null): self + { + $new = clone $this; + $new->type = $type; + + return $new; + } } diff --git a/src/Provider/Photon/Photon.php b/src/Provider/Photon/Photon.php index cdeea8978..d9d423c4e 100644 --- a/src/Provider/Photon/Photon.php +++ b/src/Provider/Photon/Photon.php @@ -70,7 +70,18 @@ public function geocodeQuery(GeocodeQuery $query): Collection 'q' => $address, 'limit' => $query->getLimit(), 'lang' => $query->getLocale(), + 'lat' => $query->getData('lat'), + 'lon' => $query->getData('lon'), ]); + $url .= $this->buildLayerFilterQuery($query->getData('layer')); + $osmTagFilters = $this->buildOsmTagFilterQuery($query->getData('osm_tag')); + if (!empty($osmTagFilters)) { + $url .= $osmTagFilters; + } + $bboxQueryString = $this->buildBboxFilterQuery($query); + if (!is_null($bboxQueryString)) { + $url .= $bboxQueryString; + } $json = $this->executeQuery($url); @@ -98,8 +109,15 @@ public function reverseQuery(ReverseQuery $query): Collection .http_build_query([ 'lat' => $latitude, 'lon' => $longitude, + 'radius' => $query->getData('radius'), + 'limit' => $query->getLimit(), 'lang' => $query->getLocale(), ]); + $url .= $this->buildLayerFilterQuery($query->getData('layer')); + $osmTagFilters = $this->buildOsmTagFilterQuery($query->getData('osm_tag')); + if (!empty($osmTagFilters)) { + $url .= $osmTagFilters; + } $json = $this->executeQuery($url); @@ -148,7 +166,8 @@ private function featureToAddress(\stdClass $feature): Location ->withName($properties->name ?? null) ->withState($properties->state ?? null) ->withCounty($properties->county ?? null) - ->withDistrict($properties->district ?? null); + ->withDistrict($properties->district ?? null) + ->withType($properties->type ?? null); return $address; } @@ -158,6 +177,58 @@ public function getName(): string return 'photon'; } + /** + * @param string|string[]|null $layers + */ + private function buildLayerFilterQuery(mixed $layers): string + { + $query = ''; + if (null === $layers) { + return $query; + } + if (is_string($layers)) { + return '&layer='.urlencode($layers); + } + foreach ($layers as $layer) { + $query .= '&layer='.urlencode($layer); + } + + return $query; + } + + /** + * @param string|array|null $filters + */ + private function buildOsmTagFilterQuery($filters): string + { + $query = ''; + if (null === $filters) { + return $query; + } + if (is_string($filters)) { + return '&osm_tag='.urlencode($filters); + } + foreach ($filters as $filter) { + $query .= '&osm_tag='.urlencode($filter); + } + + return $query; + } + + private function buildBboxFilterQuery(GeocodeQuery $query): ?string + { + if (null === $query->getBounds()) { + return null; + } + + return '&bbox='.sprintf('%f,%f,%f,%f', + $query->getBounds()->getWest(), + $query->getBounds()->getSouth(), + $query->getBounds()->getEast(), + $query->getBounds()->getNorth() + ); + } + private function executeQuery(string $url): \stdClass { $content = $this->getUrlContents($url); diff --git a/src/Provider/Photon/Readme.md b/src/Provider/Photon/Readme.md index bfd981ad5..c684245f7 100644 --- a/src/Provider/Photon/Readme.md +++ b/src/Provider/Photon/Readme.md @@ -10,13 +10,56 @@ This is the photon provider from the PHP Geocoder. This is a **READ ONLY** repository. See the [main repo](https://github.com/geocoder-php/Geocoder) for information and documentation. -### Install - +## Install ```bash composer require geocoder-php/photon-provider ``` -### Contribute +## API Documentation +https://photon.komoot.io +https://github.com/komoot/photon + +## Usage + +### Basic usage +You can use your own photon instance : +```php +// New instance of the provider : +$provider = new Geocoder\Provider\Photon\Photon($httpClient, 'https://your-photon-root-url'); +// Run geocode or reverse query +$query = $provider->geocodeQuery(\Geocoder\Query\GeocodeQuery::create('Paris')); +$reverseQuery = $provider->reverseQuery(\Geocoder\Query\ReverseQuery::fromCoordinates(48.86036 ,2.33852)); +``` + +### OSM Tag Feature +You can search for location data based on osm tag filters. + +For example, you can filter a geocode query to only include results of type 'place'. You can even restrict it to only have places of type 'city'. +In the reverse geocoding context you can search for the 3 pharmacies closest to a location. + +To see what you can do with this feature, check [the official photon documentation](https://github.com/komoot/photon#filter-results-by-tags-and-values) + +Below is an example to query the 3 pharmacies closest to a location : +```php +$provider = new Geocoder\Provider\Photon\Photon($httpClient, 'https://your-photon-root-url'); +$reverseQuery = \Geocoder\Query\ReverseQuery::fromCoordinates(52.51644, 13.38890) + ->withData('osm_tag', 'amenity:pharmacy') + ->withLimit(3); + +$results = $provider->reverseQuery($reverseQuery); +``` + +You can combine multiple osm tag filters : +```php +$provider = new Geocoder\Provider\Photon\Photon($httpClient, 'https://your-photon-root-url'); +$reverseQuery = \Geocoder\Query\GeocodeQuery::create('Paris') + ->withData('osm_tag', ['tourism:museum', 'tourism:gallery']) + ->withLimit(5); +// Here we get 5 tourism results in Paris which are either museum or art gallery +$results = $provider->reverseQuery($reverseQuery); +``` + -Contributions are very welcome! Send a pull request to the [main repository](https://github.com/geocoder-php/Geocoder) or +## Contribute +Contributions are very welcome! Send a pull request to the [main repository](https://github.com/geocoder-php/Geocoder) or report any issues you find on the [issue tracker](https://github.com/geocoder-php/Geocoder/issues). diff --git a/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_36b7f4cab09652077420062dc53bc340e8b2b22d b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_36b7f4cab09652077420062dc53bc340e8b2b22d deleted file mode 100644 index 45e7c2303..000000000 --- a/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_36b7f4cab09652077420062dc53bc340e8b2b22d +++ /dev/null @@ -1 +0,0 @@ -s:455:"{"features":[{"geometry":{"coordinates":[-77.036931,38.900368],"type":"Point"},"type":"Feature","properties":{"osm_id":5076279021,"country":"United States of America","city":"Washington","countrycode":"US","postcode":"20012","locality":"Golden Triangle","type":"house","osm_type":"N","osm_key":"man_made","housenumber":"800","street":"Black Lives Matter Plaza Northwest","osm_value":"surveillance","state":"Washington, D.C."}}],"type":"FeatureCollection"}"; \ No newline at end of file diff --git a/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_3c362ba852ee2323f9f25ca02c28cc5238959dbc b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_3c362ba852ee2323f9f25ca02c28cc5238959dbc new file mode 100644 index 000000000..4bf2c6c13 --- /dev/null +++ b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_3c362ba852ee2323f9f25ca02c28cc5238959dbc @@ -0,0 +1 @@ +s:1219:"{"features":[{"geometry":{"coordinates":[13.3879579,52.5185603],"type":"Point"},"type":"Feature","properties":{"osm_id":380498298,"country":"Deutschland","city":"Berlin","countrycode":"DE","postcode":"10117","locality":"Dorotheenstadt","type":"house","osm_type":"N","osm_key":"amenity","housenumber":"151","street":"Friedrichstraße","district":"Mitte","osm_value":"pharmacy","name":"Dorotheenstadt Apotheke"}},{"geometry":{"coordinates":[13.3874475,52.5196854],"type":"Point"},"type":"Feature","properties":{"osm_id":3331787468,"country":"Deutschland","city":"Berlin","countrycode":"DE","postcode":"10117","locality":"Dorotheenstadt","type":"house","osm_type":"N","osm_key":"amenity","housenumber":"25","street":"Georgenstraße","district":"Mitte","osm_value":"pharmacy","name":"Aschenbachs Apotheke"}},{"geometry":{"coordinates":[13.3903812,52.5122639],"type":"Point"},"type":"Feature","properties":{"osm_id":956306643,"country":"Deutschland","city":"Berlin","countrycode":"DE","postcode":"10117","locality":"Dorotheenstadt","type":"house","osm_type":"N","osm_key":"amenity","housenumber":"68","street":"Friedrichstraße","district":"Mitte","osm_value":"pharmacy","name":"Apotheke Q205"}}],"type":"FeatureCollection"}"; \ No newline at end of file diff --git a/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_4d9e19f668373f9804a90f41f1a499a74ded2594 b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_4d9e19f668373f9804a90f41f1a499a74ded2594 new file mode 100644 index 000000000..bc7c5a595 --- /dev/null +++ b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_4d9e19f668373f9804a90f41f1a499a74ded2594 @@ -0,0 +1 @@ +s:359:"{"features":[{"geometry":{"coordinates":[21.2392122,49.0000074],"type":"Point"},"type":"Feature","properties":{"osm_type":"R","osm_id":388255,"extent":[20.870461,49.185185,21.485864,48.810739],"country":"Slovensko","osm_key":"place","countrycode":"SK","osm_value":"city","name":"Prešov","state":"Prešovský kraj","type":"city"}}],"type":"FeatureCollection"}"; \ No newline at end of file diff --git a/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_61baba2ee6bc4ba2e6688559d40d4e58e1ddd7c1 b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_61baba2ee6bc4ba2e6688559d40d4e58e1ddd7c1 deleted file mode 100644 index 916081189..000000000 --- a/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_61baba2ee6bc4ba2e6688559d40d4e58e1ddd7c1 +++ /dev/null @@ -1 +0,0 @@ -s:2279:"{"features":[{"geometry":{"coordinates":[-0.1285993,51.5010484],"type":"Point"},"type":"Feature","properties":{"osm_id":2806295309,"country":"United Kingdom","city":"London","countrycode":"GB","postcode":"SW1P 3AE","locality":"Westminster","county":"Greater London","type":"house","osm_type":"N","osm_key":"office","housenumber":"8\u201310","street":"Great George Street","district":"Millbank","osm_value":"warmonger","name":"Finmeccanica UK Ltd","state":"England"}},{"geometry":{"coordinates":[-0.12770820958562096,51.50344025],"type":"Point"},"type":"Feature","properties":{"osm_id":1879842,"extent":[-0.1278356,51.5036483,-0.1273038,51.5032573],"country":"United Kingdom","countrycode":"GB","postcode":"SW1A 2AA","locality":"Westminster","county":"Greater London","type":"house","osm_type":"R","osm_key":"tourism","housenumber":"10","street":"Downing Street","district":"Covent Garden","osm_value":"attraction","name":"Prime Minister\u2019s Office","state":"England"}},{"geometry":{"coordinates":[-0.2765595,51.6136283],"type":"Point"},"type":"Feature","properties":{"osm_id":7179640410,"country":"United Kingdom","city":"Edgware, London","countrycode":"GB","postcode":"HA8 7JJ","county":"Greater London","type":"house","osm_type":"N","osm_key":"amenity","housenumber":"103","street":"Station Road","district":"Mill Hill","osm_value":"bank","name":"HSBC UK","state":"England"}},{"geometry":{"coordinates":[-0.1050314,51.5149368],"type":"Point"},"type":"Feature","properties":{"osm_id":6878399378,"country":"United Kingdom","city":"City of London","countrycode":"GB","postcode":"EC4A 4AD","locality":"Blackfriars","county":"Greater London","type":"house","osm_type":"N","osm_key":"office","housenumber":"10","street":"Saint Bride Street","osm_value":"company","name":"techUK","state":"England"}},{"geometry":{"coordinates":[-0.0469504,51.6429794],"type":"Point"},"type":"Feature","properties":{"osm_id":2444967088,"country":"United Kingdom","city":"London Borough of Enfield","countrycode":"GB","postcode":"EN3 4ES","locality":"Enfield Highway","county":"Greater London","type":"house","osm_type":"N","osm_key":"shop","housenumber":"106","street":"High Street","district":"Ponders End","osm_value":"car_parts","name":"UK Garage","state":"England"}}],"type":"FeatureCollection"}"; \ No newline at end of file diff --git a/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_6ab584da133fb849cb0cffafad872b65d3da3de1 b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_6ab584da133fb849cb0cffafad872b65d3da3de1 new file mode 100644 index 000000000..bd0964e26 --- /dev/null +++ b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_6ab584da133fb849cb0cffafad872b65d3da3de1 @@ -0,0 +1 @@ +s:334:"{"features":[{"geometry":{"coordinates":[13.3989367,52.510885],"type":"Point"},"type":"Feature","properties":{"osm_type":"R","osm_id":62422,"extent":[13.088345,52.6755087,13.7611609,52.3382448],"country":"Deutschland","osm_key":"place","countrycode":"DE","osm_value":"city","name":"Berlin","type":"city"}}],"type":"FeatureCollection"}"; \ No newline at end of file diff --git a/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_98f80bc58862d177a1c6507d33f5c83a88ab1ffd b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_723a82c29164f0fc32d4c774f86c4569afdd804b similarity index 100% rename from src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_98f80bc58862d177a1c6507d33f5c83a88ab1ffd rename to src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_723a82c29164f0fc32d4c774f86c4569afdd804b diff --git a/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_77590bd663047da83d48c67d9101f04a82e48976 b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_77590bd663047da83d48c67d9101f04a82e48976 new file mode 100644 index 000000000..b9e1d963f --- /dev/null +++ b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_77590bd663047da83d48c67d9101f04a82e48976 @@ -0,0 +1 @@ +s:2127:"{"features":[{"geometry":{"coordinates":[-77.0372192,38.9002248],"type":"Point"},"type":"Feature","properties":{"osm_type":"W","osm_id":1049842804,"extent":[-77.0372192,38.9002248,-77.0370581,38.9002243],"country":"United States","osm_key":"highway","city":"Washington","countrycode":"US","osm_value":"secondary","postcode":"20006","name":"H Street Northwest","state":"District of Columbia","type":"street"}},{"geometry":{"coordinates":[-77.0366811,38.9002231],"type":"Point"},"type":"Feature","properties":{"osm_type":"W","osm_id":589539534,"extent":[-77.0370581,38.9002243,-77.0365521,38.9002187],"country":"United States","osm_key":"highway","city":"Washington","countrycode":"US","osm_value":"secondary","postcode":"20006","name":"H Street Northwest","state":"District of Columbia","type":"street"}},{"geometry":{"coordinates":[-77.03689992471391,38.90050395],"type":"Point"},"type":"Feature","properties":{"osm_id":55326891,"extent":[-77.0371738,38.9006934,-77.0367231,38.9003173],"country":"United States","city":"Washington","countrycode":"US","postcode":"20006","locality":"Golden Triangle","type":"house","osm_type":"W","osm_key":"tourism","housenumber":"800","street":"Black Lives Matter Plaza Northwest","osm_value":"hotel","name":"Hay-Adams Hotel","state":"District of Columbia"}},{"geometry":{"coordinates":[-77.0374769,38.9003895],"type":"Point"},"type":"Feature","properties":{"osm_type":"N","osm_id":367142942,"country":"United States","osm_key":"building","city":"Washington","street":"H Street Northwest","countrycode":"US","osm_value":"public","postcode":"20006","name":"United States Chamber of Commerce Building","state":"District of Columbia","type":"house"}},{"geometry":{"coordinates":[-77.0364753,38.9003613],"type":"Point"},"type":"Feature","properties":{"osm_id":4957653991,"country":"United States","city":"Washington","countrycode":"US","postcode":"20062","locality":"Golden Triangle","type":"house","osm_type":"N","osm_key":"tourism","street":"Black Lives Matter Plaza Northwest","osm_value":"information","name":"16th Street Meridian","state":"District of Columbia"}}],"type":"FeatureCollection"}"; \ No newline at end of file diff --git a/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_83d30d7d0b77d2526ba7d750ad29a2daae002647 b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_83d30d7d0b77d2526ba7d750ad29a2daae002647 new file mode 100644 index 000000000..7296f064e --- /dev/null +++ b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_83d30d7d0b77d2526ba7d750ad29a2daae002647 @@ -0,0 +1 @@ +s:535:"{"features":[{"geometry":{"coordinates":[2.3200410217200766,48.8588897],"type":"Point"},"type":"Feature","properties":{"osm_type":"R","osm_id":7444,"extent":[2.224122,48.902156,2.4697602,48.8155755],"country":"France","osm_key":"boundary","city":"Paris","countrycode":"FR","osm_value":"administrative","postcode":"75000;75001;75002;75003;75004;75005;75006;75007;75008;75009;75010;75011;75012;75013;75014;75015;75016;75017;75018;75019;75020;75116","name":"Paris","state":"Île-de-France","type":"district"}}],"type":"FeatureCollection"}"; \ No newline at end of file diff --git a/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_8cd3447834c3ae8316dda602714b4ca4959eae65 b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_8cd3447834c3ae8316dda602714b4ca4959eae65 new file mode 100644 index 000000000..6e057cd72 --- /dev/null +++ b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_8cd3447834c3ae8316dda602714b4ca4959eae65 @@ -0,0 +1 @@ +s:2187:"{"features":[{"geometry":{"coordinates":[2.2978602225671843,48.8643133],"type":"Point"},"type":"Feature","properties":{"osm_id":79219308,"extent":[2.2971088,48.8647083,2.2984772,48.8639024],"country":"France","city":"Paris","countrycode":"FR","postcode":"75116","locality":"Quartier de Chaillot","type":"house","osm_type":"W","osm_key":"tourism","street":"Rue Gaston de Saint-Paul","district":"Paris","osm_value":"museum","name":"Musée d'Art Moderne de Paris","state":"Île-de-France"}},{"geometry":{"coordinates":[2.3518758,48.850724],"type":"Point"},"type":"Feature","properties":{"osm_id":237003117,"country":"France","city":"Paris","countrycode":"FR","postcode":"75005","locality":"Quartier Saint-Victor","type":"house","osm_type":"N","osm_key":"tourism","street":"Quai de la Tournelle","district":"Paris","osm_value":"museum","name":"Musée de l'Assistance Publique Hôpitaux de Paris","state":"Île-de-France"}},{"geometry":{"coordinates":[2.3450724,48.8640506],"type":"Point"},"type":"Feature","properties":{"osm_id":3087374948,"country":"France","city":"Paris","countrycode":"FR","postcode":"75001","locality":"Les Halles","type":"house","osm_type":"N","osm_key":"tourism","street":"Rue du Jour","district":"Paris","osm_value":"museum","name":"Musée du Barreau de Paris","state":"Île-de-France"}},{"geometry":{"coordinates":[2.3153496472839956,48.866042],"type":"Point"},"type":"Feature","properties":{"osm_id":2778854,"extent":[2.3143339,48.866628,2.3156049,48.8654594],"country":"France","city":"Paris","countrycode":"FR","postcode":"75008","locality":"Quartier des Champs-Élysées","type":"house","osm_type":"R","osm_key":"tourism","street":"Avenue Winston Churchill","district":"Paris","osm_value":"museum","name":"Petit Palais","state":"Île-de-France"}},{"geometry":{"coordinates":[2.3453019,48.8625016],"type":"Point"},"type":"Feature","properties":{"osm_id":1028569468,"country":"France","city":"Paris","countrycode":"FR","postcode":"75001","locality":"Les Halles","type":"house","osm_type":"N","osm_key":"tourism","street":"Rue du Cinéma","district":"Paris","osm_value":"museum","name":"Salle des collections","state":"Île-de-France"}}],"type":"FeatureCollection"}"; \ No newline at end of file diff --git a/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_ab0a3e352306e701cef79478d26bdd56f4598e81 b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_ab0a3e352306e701cef79478d26bdd56f4598e81 new file mode 100644 index 000000000..edcf21a38 --- /dev/null +++ b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_ab0a3e352306e701cef79478d26bdd56f4598e81 @@ -0,0 +1 @@ +s:2001:"{"features":[{"geometry":{"coordinates":[2.3200410217200766,48.8588897],"type":"Point"},"type":"Feature","properties":{"osm_type":"R","osm_id":7444,"extent":[2.224122,48.902156,2.4697602,48.8155755],"country":"France","osm_key":"boundary","city":"Paris","countrycode":"FR","osm_value":"administrative","postcode":"75000;75001;75002;75003;75004;75005;75006;75007;75008;75009;75010;75011;75012;75013;75014;75015;75016;75017;75018;75019;75020;75116","name":"Paris","state":"Île-de-France","type":"district"}},{"geometry":{"coordinates":[2.3483915,48.8534951],"type":"Point"},"type":"Feature","properties":{"osm_type":"R","osm_id":71525,"extent":[2.224122,48.902156,2.4697602,48.8155755],"country":"France","osm_key":"place","countrycode":"FR","osm_value":"city","name":"Paris","state":"Île-de-France","type":"city"}},{"geometry":{"coordinates":[2.3200410217200766,48.8588897],"type":"Point"},"type":"Feature","properties":{"osm_type":"R","osm_id":1641193,"extent":[2.224122,48.902156,2.4697602,48.8155755],"country":"France","osm_key":"boundary","city":"Paris","countrycode":"FR","osm_value":"administrative","name":"Paris","state":"Île-de-France","type":"district"}},{"geometry":{"coordinates":[-95.555513,33.6617962],"type":"Point"},"type":"Feature","properties":{"osm_type":"R","osm_id":115357,"extent":[-95.6279396,33.7383866,-95.4354115,33.6206345],"country":"United States","osm_key":"place","countrycode":"US","osm_value":"town","name":"Paris","county":"Lamar","state":"Texas","type":"city"}},{"geometry":{"coordinates":[2.3365253984179155,48.8365091],"type":"Point"},"type":"Feature","properties":{"osm_id":79611305,"extent":[2.3358691,48.8366578,2.3371706,48.836243],"country":"France","city":"Paris","countrycode":"FR","postcode":"75014","locality":"Quartier du Montparnasse","type":"house","osm_type":"W","osm_key":"building","street":"Avenue de l'Observatoire","district":"Paris","osm_value":"historic","name":"Observatoire de Paris","state":"Île-de-France"}}],"type":"FeatureCollection"}"; \ No newline at end of file diff --git a/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_e564cba10f78e298ecde7f804fbfb15d7d430ebc b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_e564cba10f78e298ecde7f804fbfb15d7d430ebc new file mode 100644 index 000000000..80cb7b8b9 --- /dev/null +++ b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_e564cba10f78e298ecde7f804fbfb15d7d430ebc @@ -0,0 +1 @@ +s:373:"{"features":[{"geometry":{"coordinates":[-95.555513,33.6617962],"type":"Point"},"type":"Feature","properties":{"osm_type":"R","osm_id":115357,"extent":[-95.6279396,33.7383866,-95.4354115,33.6206345],"country":"United States","osm_key":"place","countrycode":"US","osm_value":"town","name":"Paris","county":"Lamar","state":"Texas","type":"city"}}],"type":"FeatureCollection"}"; \ No newline at end of file diff --git a/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_ed91365025e794205300bed4ad45119eeeed5f3f b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_ed91365025e794205300bed4ad45119eeeed5f3f new file mode 100644 index 000000000..19cda6b8d --- /dev/null +++ b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_ed91365025e794205300bed4ad45119eeeed5f3f @@ -0,0 +1 @@ +s:703:"{"features":[{"geometry":{"coordinates":[21.2392122,49.0000074],"type":"Point"},"type":"Feature","properties":{"osm_type":"R","osm_id":388255,"extent":[20.870461,49.185185,21.485864,48.810739],"country":"Slovensko","osm_key":"place","countrycode":"SK","osm_value":"city","name":"Prešov","state":"Prešovský kraj","type":"city"}},{"geometry":{"coordinates":[21.2392122,49.0000074],"type":"Point"},"type":"Feature","properties":{"osm_type":"R","osm_id":2320257,"extent":[21.1569866,49.0468381,21.3354271,48.9449997],"country":"Slovensko","osm_key":"place","city":"Prešov","countrycode":"SK","osm_value":"city","name":"Prešov","state":"Prešovský kraj","type":"district"}}],"type":"FeatureCollection"}"; \ No newline at end of file diff --git a/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_efc348818ff5a7d34fc7305bb97f5738b2ea8f8d b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_efc348818ff5a7d34fc7305bb97f5738b2ea8f8d new file mode 100644 index 000000000..bc6d78d4c --- /dev/null +++ b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_efc348818ff5a7d34fc7305bb97f5738b2ea8f8d @@ -0,0 +1 @@ +s:813:"{"features":[{"geometry":{"coordinates":[8.1147545,49.833289],"type":"Point"},"type":"Feature","properties":{"osm_id":1310664730,"extent":[8.1147525,49.8336895,8.1147673,49.8331048],"country":"Deutschland","city":"Wörrstadt","countrycode":"DE","postcode":"55286","county":"Alzey-Worms","type":"street","osm_type":"W","osm_key":"highway","osm_value":"primary","name":"Pariser Straße","state":"Rheinland-Pfalz"}},{"geometry":{"coordinates":[13.378690821250334,52.51635135],"type":"Point"},"type":"Feature","properties":{"osm_type":"R","osm_id":181198,"extent":[13.3777517,52.5169588,13.3798039,52.5157489],"country":"Deutschland","osm_key":"place","city":"Berlin","countrycode":"DE","district":"Mitte","osm_value":"square","postcode":"10117","name":"Pariser Platz","type":"locality"}}],"type":"FeatureCollection"}"; \ No newline at end of file diff --git a/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_f02c930445a15eb88482c0cc3c22a782c9ee6005 b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_f02c930445a15eb88482c0cc3c22a782c9ee6005 new file mode 100644 index 000000000..d23d4a4ec --- /dev/null +++ b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_f02c930445a15eb88482c0cc3c22a782c9ee6005 @@ -0,0 +1 @@ +s:4208:"{"features":[{"geometry":{"coordinates":[2.2978602225671843,48.8643133],"type":"Point"},"type":"Feature","properties":{"osm_id":79219308,"extent":[2.2971088,48.8647083,2.2984772,48.8639024],"country":"France","city":"Paris","countrycode":"FR","postcode":"75116","locality":"Chaillot","type":"house","osm_type":"W","osm_key":"tourism","street":"Rue Gaston de Saint-Paul","district":"Paris","osm_value":"museum","name":"Musée d'Art Moderne de Paris","state":"Île-de-France"}},{"geometry":{"coordinates":[2.3153496472839956,48.866042],"type":"Point"},"type":"Feature","properties":{"osm_id":2778854,"extent":[2.3143339,48.866628,2.3156049,48.8654594],"country":"France","city":"Paris","countrycode":"FR","postcode":"75008","locality":"Quartier des Champs-Élysées","type":"house","osm_type":"R","osm_key":"tourism","street":"Avenue Winston Churchill","district":"Paris","osm_value":"museum","name":"Musée des beaux-arts de la Ville de Paris","state":"Île-de-France"}},{"geometry":{"coordinates":[2.3518758,48.850724],"type":"Point"},"type":"Feature","properties":{"osm_id":237003117,"country":"France","city":"Paris","countrycode":"FR","postcode":"75005","locality":"Quartier Saint-Victor","type":"house","osm_type":"N","osm_key":"tourism","street":"Quai de la Tournelle","district":"Paris","osm_value":"museum","name":"Musée de l'Assistance Publique Hôpitaux de Paris","state":"Île-de-France"}},{"geometry":{"coordinates":[2.3450724,48.8640506],"type":"Point"},"type":"Feature","properties":{"osm_id":3087374948,"country":"France","city":"Paris","countrycode":"FR","postcode":"75001","locality":"Les Halles","type":"house","osm_type":"N","osm_key":"tourism","street":"Rue du Jour","district":"Paris","osm_value":"museum","name":"Musée du Barreau de Paris","state":"Île-de-France"}},{"geometry":{"coordinates":[2.3453019,48.8625016],"type":"Point"},"type":"Feature","properties":{"osm_id":1028569468,"country":"France","city":"Paris 1er Arrondissement","countrycode":"FR","postcode":"75001","locality":"Les Halles","type":"house","osm_type":"N","osm_key":"tourism","street":"Rue du cinéma","district":"Paris","osm_value":"museum","name":"Salle des collections","state":"Île-de-France"}},{"geometry":{"coordinates":[2.3587471,48.865943],"type":"Point"},"type":"Feature","properties":{"osm_id":5275610309,"country":"France","city":"Paris","countrycode":"FR","postcode":"75003","locality":"Quartier des Arts-et-Métiers","type":"house","osm_type":"N","osm_key":"tourism","street":"Rue de Turbigo","district":"Paris","osm_value":"gallery","name":"Paris-B","state":"Île-de-France"}},{"geometry":{"coordinates":[2.3314642,48.881227],"type":"Point"},"type":"Feature","properties":{"osm_id":10677716841,"country":"France","city":"Paris","countrycode":"FR","postcode":"75009","locality":"Quartier Saint-Georges","type":"house","osm_type":"N","osm_key":"tourism","street":"Rue Blanche","district":"Paris","osm_value":"gallery","name":"Mu Gallery Paris","state":"Île-de-France"}},{"geometry":{"coordinates":[2.3736064,48.8623128],"type":"Point"},"type":"Feature","properties":{"osm_id":10130759032,"country":"France","city":"Paris","countrycode":"FR","postcode":"75011","locality":"Quartier Saint-Ambroise","type":"house","osm_type":"N","osm_key":"tourism","street":"Rue Saint-Sébastien","district":"Paris","osm_value":"gallery","name":"Paris-New York","state":"Île-de-France"}},{"geometry":{"coordinates":[2.3644211,48.8602831],"type":"Point"},"type":"Feature","properties":{"osm_id":3210924575,"country":"France","city":"Paris","countrycode":"FR","postcode":"75003","locality":"Quartier des Archives","type":"house","osm_type":"N","osm_key":"tourism","street":"Rue Debelleyme","district":"Le Marais","osm_value":"gallery","name":"lecœur-paris.com","state":"Île-de-France"}},{"geometry":{"coordinates":[2.3525427,48.86361],"type":"Point"},"type":"Feature","properties":{"osm_id":10744217145,"country":"France","city":"Paris","countrycode":"FR","postcode":"75003","locality":"Quartier Sainte-Avoye","type":"house","osm_type":"N","osm_key":"tourism","street":"Rue Saint-Martin","district":"Paris","osm_value":"gallery","name":"Galerie Paris Horizon","state":"Île-de-France"}}],"type":"FeatureCollection"}"; \ No newline at end of file diff --git a/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_fb4e33e538bd52319d02f18862965a0c30d78dfd b/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_fb4e33e538bd52319d02f18862965a0c30d78dfd deleted file mode 100644 index c3b709ce4..000000000 --- a/src/Provider/Photon/Tests/.cached_responses/photon.komoot.io_fb4e33e538bd52319d02f18862965a0c30d78dfd +++ /dev/null @@ -1 +0,0 @@ -s:246:"{"features":[{"geometry":{"coordinates":[0,0],"type":"Point"},"type":"Feature","properties":{"osm_id":3815077900,"osm_type":"N","osm_key":"man_made","osm_value":"monitoring_station","name":"Soul Buoy","type":"house"}}],"type":"FeatureCollection"}"; \ No newline at end of file diff --git a/src/Provider/Photon/Tests/PhotonTest.php b/src/Provider/Photon/Tests/PhotonTest.php index 513688d44..3afd74861 100644 --- a/src/Provider/Photon/Tests/PhotonTest.php +++ b/src/Provider/Photon/Tests/PhotonTest.php @@ -13,6 +13,8 @@ namespace Geocoder\Provider\Photon\Tests; use Geocoder\IntegrationTest\BaseTestCase; +use Geocoder\Model\AddressCollection; +use Geocoder\Provider\Photon\Model\PhotonAddress; use Geocoder\Provider\Photon\Photon; use Geocoder\Query\GeocodeQuery; use Geocoder\Query\ReverseQuery; @@ -56,12 +58,12 @@ public function testGeocodeQuery(): void $provider = Photon::withKomootServer($this->getHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('10 avenue Gambetta, Paris, France')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(AddressCollection::class, $results); $this->assertCount(1, $results); - /** @var \Geocoder\Provider\Photon\Model\PhotonAddress $result */ + /** @var PhotonAddress $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(48.8631927, $result->getCoordinates()->getLatitude(), 0.00001); $this->assertEqualsWithDelta(2.3890894, $result->getCoordinates()->getLongitude(), 0.00001); $this->assertEquals('10', $result->getStreetNumber()); @@ -85,26 +87,86 @@ public function testGeocodeQueryWithNamedResult(): void $provider = Photon::withKomootServer($this->getHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('Sherlock Holmes Museum, 221B Baker St, London, England')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(AddressCollection::class, $results); $this->assertCount(1, $results); - /** @var \Geocoder\Provider\Photon\Model\PhotonAddress $result */ + /** @var PhotonAddress $result */ $result = $results->first(); $this->assertEquals('The Sherlock Holmes Museum and shop', $result->getName()); } + public function testGeocodeQueryWithOsmTagFilter(): void + { + $provider = Photon::withKomootServer($this->getHttpClient()); + $query = GeocodeQuery::create('Paris') + ->withData('osm_tag', 'tourism:museum') + ->withLimit(5); + $results = $provider->geocodeQuery($query); + + $this->assertCount(5, $results); + foreach ($results as $result) { + $this->assertInstanceOf(PhotonAddress::class, $result); + $this->assertEquals('tourism', $result->getOSMTag()->key); + $this->assertEquals('museum', $result->getOSMTag()->value); + } + } + + public function testGeocodeQueryWithMultipleOsmTagFilter(): void + { + $provider = Photon::withKomootServer($this->getHttpClient()); + $query = GeocodeQuery::create('Paris') + ->withData('osm_tag', ['tourism:museum', 'tourism:gallery']) + ->withLimit(10); + $results = $provider->geocodeQuery($query); + + $this->assertCount(10, $results); + $countMuseums = $countGalleries = 0; + foreach ($results as $result) { + $this->assertInstanceOf(PhotonAddress::class, $result); + $this->assertEquals('tourism', $result->getOSMTag()->key); + $this->assertContains($result->getOSMTag()->value, ['museum', 'gallery']); + if ('museum' === $result->getOSMTag()->value) { + ++$countMuseums; + } elseif ('gallery' === $result->getOSMTag()->value) { + ++$countGalleries; + } + } + $this->assertGreaterThan(0, $countMuseums); + $this->assertGreaterThan(0, $countGalleries); + } + + public function testGeocodeQueryWithLatLon(): void + { + $provider = Photon::withKomootServer($this->getHttpClient()); + + $query = GeocodeQuery::create('Paris')->withLimit(1); + $results = $provider->geocodeQuery($query); + $this->assertInstanceOf(AddressCollection::class, $results); + $this->assertCount(1, $results); + $this->assertEquals('France', $results->first()->getCountry()); + + $query = $query + ->withData('lat', 33.661426) + ->withData('lon', -95.556321); + $results = $provider->geocodeQuery($query); + $this->assertInstanceOf(AddressCollection::class, $results); + $this->assertCount(1, $results); + $this->assertEquals('United States', $results->first()->getCountry()); + } + public function testReverseQuery(): void { $provider = Photon::withKomootServer($this->getHttpClient()); - $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(52, 10)); + $reverseQuery = ReverseQuery::fromCoordinates(52, 10)->withLimit(1); + $results = $provider->reverseQuery($reverseQuery); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(AddressCollection::class, $results); $this->assertCount(1, $results); - /** @var \Geocoder\Provider\Photon\Model\PhotonAddress $result */ + /** @var PhotonAddress $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(51.9982968, $result->getCoordinates()->getLatitude(), 0.00001); $this->assertEqualsWithDelta(9.998645, $result->getCoordinates()->getLongitude(), 0.00001); $this->assertEquals('31195', $result->getPostalCode()); @@ -120,4 +182,89 @@ public function testReverseQuery(): void $this->assertEquals('Landkreis Hildesheim', $result->getCounty()); $this->assertEquals('Sehlem', $result->getDistrict()); } + + public function testReverseQueryWithOsmTagFilter(): void + { + $provider = Photon::withKomootServer($this->getHttpClient()); + $reverseQuery = ReverseQuery::fromCoordinates(52.51644, 13.38890) + ->withData('osm_tag', 'amenity:pharmacy') + ->withLimit(3); + $results = $provider->reverseQuery($reverseQuery); + + $this->assertCount(3, $results); + foreach ($results as $result) { + $this->assertInstanceOf(PhotonAddress::class, $result); + $this->assertEquals('amenity', $result->getOSMTag()->key); + $this->assertEquals('pharmacy', $result->getOSMTag()->value); + } + } + + public function testReverseQueryWithLayerCityAndRadiusFilter(): void + { + $provider = Photon::withKomootServer($this->getHttpClient()); + $reverseQuery = ReverseQuery::fromCoordinates(52.51644, 13.38890) + ->withData('layer', 'city') + ->withData('radius', 20) + ->withLimit(1); + $result = $provider->reverseQuery($reverseQuery)->first(); + + $this->assertInstanceOf(PhotonAddress::class, $result); + $this->assertEquals('city', $result->getType()); + $this->assertEquals('Berlin', $result->getLocality()); + } + + public function testReverseQueryWithMultipleLayers(): void + { + $provider = Photon::withKomootServer($this->getHttpClient()); + $reverseQuery = ReverseQuery::fromCoordinates(49.001831, 21.239311) + ->withData('layer', 'city') + ->withLimit(2); + + $results = $provider->reverseQuery($reverseQuery); + $this->assertInstanceOf(AddressCollection::class, $results); + $this->assertCount(1, $results); + $result0 = $results->get(0); + $this->assertInstanceOf(PhotonAddress::class, $result0); + $this->assertEquals('city', $result0->getType()); + + $reverseQuery = $reverseQuery->withData('layer', ['city', 'district']); + $results = $provider->reverseQuery($reverseQuery); + $this->assertInstanceOf(AddressCollection::class, $results); + $this->assertCount(2, $results); + $result0 = $results->get(0); + $this->assertInstanceOf(PhotonAddress::class, $result0); + $this->assertEquals('city', $result0->getType()); + $result1 = $results->get(1); + $this->assertInstanceOf(PhotonAddress::class, $result1); + $this->assertEquals('district', $result1->getType()); + } + + public function testGeocodeQueryWithBbox(): void + { + // Germany + $bounds = new \Geocoder\Model\Bounds( + south: 47.2701, + west: 5.8663, + north: 55.992, + east: 15.0419 + ); + + $provider = Photon::withKomootServer($this->getHttpClient()); + $query = GeocodeQuery::create('Paris') + ->withLimit(5); + $results = $provider->geocodeQuery($query); + + $this->assertCount(5, $results); + $this->assertEquals('France', $results->first()->getCountry()); + $this->assertEquals('Paris', $results->first()->getLocality()); + + $query = GeocodeQuery::create('Paris') + ->withBounds($bounds) + ->withLimit(5); + $results = $provider->geocodeQuery($query); + + $this->assertCount(2, $results); + $this->assertEquals('Deutschland', $results->first()->getCountry()); + $this->assertEquals('Wörrstadt', $results->first()->getLocality()); + } } diff --git a/src/Provider/Photon/composer.json b/src/Provider/Photon/composer.json index cac0d54c5..dcde5415e 100644 --- a/src/Provider/Photon/composer.json +++ b/src/Provider/Photon/composer.json @@ -13,7 +13,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.1", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/PickPoint/CHANGELOG.md b/src/Provider/PickPoint/CHANGELOG.md index fd68bf7ce..f3d6f2677 100644 --- a/src/Provider/PickPoint/CHANGELOG.md +++ b/src/Provider/PickPoint/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.4.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 4.3.0 ### Added diff --git a/src/Provider/PickPoint/Tests/PickPointTest.php b/src/Provider/PickPoint/Tests/PickPointTest.php index 5d240878a..4880ae0c1 100644 --- a/src/Provider/PickPoint/Tests/PickPointTest.php +++ b/src/Provider/PickPoint/Tests/PickPointTest.php @@ -66,12 +66,12 @@ public function testGetNodeStreetName(): void $provider = new PickPoint($this->getHttpClient($_SERVER['PICKPOINT_API_KEY']), $_SERVER['PICKPOINT_API_KEY']); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(48.86, 2.35)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEquals('Rue Quincampoix', $result->getStreetName()); } } diff --git a/src/Provider/PickPoint/composer.json b/src/Provider/PickPoint/composer.json index 5201ad714..7328cfb9b 100644 --- a/src/Provider/PickPoint/composer.json +++ b/src/Provider/PickPoint/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/TomTom/CHANGELOG.md b/src/Provider/TomTom/CHANGELOG.md index 9efac72c6..fc19de806 100644 --- a/src/Provider/TomTom/CHANGELOG.md +++ b/src/Provider/TomTom/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.5.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 4.4.0 ### Added diff --git a/src/Provider/TomTom/Tests/TomTomTest.php b/src/Provider/TomTom/Tests/TomTomTest.php index 252cd35d9..d4d74d4c4 100644 --- a/src/Provider/TomTom/Tests/TomTomTest.php +++ b/src/Provider/TomTom/Tests/TomTomTest.php @@ -45,12 +45,12 @@ public function testGeocodeWithRealAddress(): void $provider = new TomTom($this->getHttpClient($_SERVER['TOMTOM_MAP_KEY']), $_SERVER['TOMTOM_MAP_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('Tagensvej 47, 2200 København N')->withLocale('en-GB')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(55.70, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(12.5529, $result->getCoordinates()->getLongitude(), 0.001); $this->assertNull($result->getBounds()); @@ -69,12 +69,12 @@ public function testGeocodeWithRealAddressWithFrenchLocale(): void $provider = new TomTom($this->getHttpClient($_SERVER['TOMTOM_MAP_KEY']), $_SERVER['TOMTOM_MAP_KEY']); $results = $provider->geocodeQuery(GeocodeQuery::create('Tagensvej 47, 2200 København N')->withLocale('fr-FR')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); } public function testGeocodeWithLocalhostIPv4(): void @@ -159,12 +159,12 @@ public function testReverseWithRealCoordinates(): void $provider = new TomTom($this->getHttpClient($_SERVER['TOMTOM_MAP_KEY']), $_SERVER['TOMTOM_MAP_KEY']); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(48.86321648955345, 2.3887719959020615)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(48.86323, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(2.38877, $result->getCoordinates()->getLongitude(), 0.001); $this->assertNull($result->getBounds()); @@ -187,12 +187,12 @@ public function testGeocodeWithRealCoordinates(): void $provider = new TomTom($this->getHttpClient($_SERVER['TOMTOM_MAP_KEY']), $_SERVER['TOMTOM_MAP_KEY']); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(56.5231, 10.0659)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var Location $result */ $result = $results->first(); - $this->assertInstanceOf('\Geocoder\Model\Address', $result); + $this->assertInstanceOf(\Geocoder\Model\Address::class, $result); $this->assertEqualsWithDelta(56.52435, $result->getCoordinates()->getLatitude(), 0.001); $this->assertEqualsWithDelta(10.06744, $result->getCoordinates()->getLongitude(), 0.001); $this->assertNull($result->getBounds()); diff --git a/src/Provider/TomTom/composer.json b/src/Provider/TomTom/composer.json index d897fcada..138c8b4f4 100644 --- a/src/Provider/TomTom/composer.json +++ b/src/Provider/TomTom/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0" diff --git a/src/Provider/Yandex/CHANGELOG.md b/src/Provider/Yandex/CHANGELOG.md index e5ce46107..e527b1bbe 100644 --- a/src/Provider/Yandex/CHANGELOG.md +++ b/src/Provider/Yandex/CHANGELOG.md @@ -2,6 +2,12 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.6.0 + +### Added + +- Add support for PHP Geocoder 5 + ## 4.5.0 ### Added diff --git a/src/Provider/Yandex/Tests/YandexTest.php b/src/Provider/Yandex/Tests/YandexTest.php index 9b98ce4e3..8c30784a2 100644 --- a/src/Provider/Yandex/Tests/YandexTest.php +++ b/src/Provider/Yandex/Tests/YandexTest.php @@ -76,12 +76,12 @@ public function testGeocodeWithRealAddress(): void $provider = new Yandex($this->getHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('10 avenue Gambetta, Paris, France')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var YandexAddress $result */ $result = $results->first(); - $this->assertInstanceOf('Geocoder\Provider\Yandex\Model\YandexAddress', $result); + $this->assertInstanceOf(YandexAddress::class, $result); $this->assertEqualsWithDelta(48.863277, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.389016, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -111,12 +111,12 @@ public function testGeocodeWithRealAddressWithUALocale(): void $provider = new Yandex($this->getHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('Copenhagen, Denmark')->withLocale('uk-UA')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(3, $results); /** @var YandexAddress $result */ $result = $results->first(); - $this->assertInstanceOf('Geocoder\Provider\Yandex\Model\YandexAddress', $result); + $this->assertInstanceOf(YandexAddress::class, $result); $this->assertEqualsWithDelta(55.675676, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(12.585828, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -143,13 +143,13 @@ public function testGeocodeWithRealAddressWithUALocale(): void /** @var YandexAddress $result */ $result = $results->get(1); - $this->assertInstanceOf('Geocoder\Provider\Yandex\Model\YandexAddress', $result); + $this->assertInstanceOf(YandexAddress::class, $result); $this->assertEqualsWithDelta(55.716853, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(12.463837, $result->getCoordinates()->getLongitude(), 0.01); /** @var YandexAddress $result */ $result = $results->get(2); - $this->assertInstanceOf('Geocoder\Provider\Yandex\Model\YandexAddress', $result); + $this->assertInstanceOf(YandexAddress::class, $result); $this->assertEqualsWithDelta(55.590338, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(12.130041, $result->getCoordinates()->getLongitude(), 0.01); } @@ -159,12 +159,12 @@ public function testGeocodeWithRealAddressWithUSLocale(): void $provider = new Yandex($this->getHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('1600 Pennsylvania Ave, Washington')->withLocale('en-US')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var YandexAddress $result */ $result = $results->first(); - $this->assertInstanceOf('Geocoder\Provider\Yandex\Model\YandexAddress', $result); + $this->assertInstanceOf(YandexAddress::class, $result); $this->assertEqualsWithDelta(38.897695, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(-77.038692, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -194,12 +194,12 @@ public function testGeocodeWithRealAddressWithBYLocale(): void $provider = new Yandex($this->getHttpClient()); $results = $provider->geocodeQuery(GeocodeQuery::create('ул.Ленина, 19, Минск 220030, Республика Беларусь')->withLocale('be-BY')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(1, $results); /** @var YandexAddress $result */ $result = $results->first(); - $this->assertInstanceOf('Geocoder\Provider\Yandex\Model\YandexAddress', $result); + $this->assertInstanceOf(YandexAddress::class, $result); $this->assertEqualsWithDelta(53.898077, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(27.563673, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -228,12 +228,12 @@ public function testReverseWithRealCoordinates(): void $provider = new Yandex($this->getHttpClient()); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(48.863216489553, 2.388771995902061)); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var YandexAddress $result */ $result = $results->first(); - $this->assertInstanceOf('Geocoder\Provider\Yandex\Model\YandexAddress', $result); + $this->assertInstanceOf(YandexAddress::class, $result); $this->assertEqualsWithDelta(48.863212, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.388773, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -260,13 +260,13 @@ public function testReverseWithRealCoordinates(): void /** @var YandexAddress $result */ $result = $results->get(1); - $this->assertInstanceOf('Geocoder\Provider\Yandex\Model\YandexAddress', $result); + $this->assertInstanceOf(YandexAddress::class, $result); $this->assertEqualsWithDelta(48.864848, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.3993549, $result->getCoordinates()->getLongitude(), 0.01); /** @var YandexAddress $result */ $result = $results->get(2); - $this->assertInstanceOf('Geocoder\Provider\Yandex\Model\YandexAddress', $result); + $this->assertInstanceOf(YandexAddress::class, $result); $this->assertEqualsWithDelta(48.856929, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.392115, $result->getCoordinates()->getLongitude(), 0.01); } @@ -276,12 +276,12 @@ public function testReverseWithRealCoordinatesWithUSLocaleAndStreeToponym(): voi $provider = new Yandex($this->getHttpClient(), 'street'); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(48.863216489553, 2.388771995902061)->withLocale('en-US')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var YandexAddress $result */ $result = $results->first(); - $this->assertInstanceOf('Geocoder\Provider\Yandex\Model\YandexAddress', $result); + $this->assertInstanceOf(YandexAddress::class, $result); $this->assertEqualsWithDelta(48.87132, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.404017, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -308,25 +308,25 @@ public function testReverseWithRealCoordinatesWithUSLocaleAndStreeToponym(): voi /** @var YandexAddress $result */ $result = $results->get(1); - $this->assertInstanceOf('Geocoder\Provider\Yandex\Model\YandexAddress', $result); + $this->assertInstanceOf(YandexAddress::class, $result); $this->assertEqualsWithDelta(48.863230, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.388261, $result->getCoordinates()->getLongitude(), 0.01); /** @var YandexAddress $result */ $result = $results->get(2); - $this->assertInstanceOf('Geocoder\Provider\Yandex\Model\YandexAddress', $result); + $this->assertInstanceOf(YandexAddress::class, $result); $this->assertEqualsWithDelta(48.866022, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.389662, $result->getCoordinates()->getLongitude(), 0.01); /** @var YandexAddress $result */ $result = $results->get(3); - $this->assertInstanceOf('Geocoder\Provider\Yandex\Model\YandexAddress', $result); + $this->assertInstanceOf(YandexAddress::class, $result); $this->assertEqualsWithDelta(48.863918, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.387767, $result->getCoordinates()->getLongitude(), 0.01); /** @var YandexAddress $result */ $result = $results->get(4); - $this->assertInstanceOf('Geocoder\Provider\Yandex\Model\YandexAddress', $result); + $this->assertInstanceOf(YandexAddress::class, $result); $this->assertEqualsWithDelta(48.863787, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(2.389600, $result->getCoordinates()->getLongitude(), 0.01); } @@ -336,12 +336,12 @@ public function testReverseWithRealCoordinatesWithUALocaleAndHouseToponym(): voi $provider = new Yandex($this->getHttpClient(), 'house'); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(60.4539471768582, 22.2567842183875)->withLocale('uk-UA')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var YandexAddress $result */ $result = $results->first(); - $this->assertInstanceOf('Geocoder\Provider\Yandex\Model\YandexAddress', $result); + $this->assertInstanceOf(YandexAddress::class, $result); $this->assertEqualsWithDelta(60.454462, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(22.256561, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -371,12 +371,12 @@ public function testReverseWithRealCoordinatesWithTRLocaleAndLocalityToponym(): $provider = new Yandex($this->getHttpClient(), 'locality'); $results = $provider->reverseQuery(ReverseQuery::fromCoordinates(40.900640, 29.198184)->withLocale('tr-TR')); - $this->assertInstanceOf('Geocoder\Model\AddressCollection', $results); + $this->assertInstanceOf(\Geocoder\Model\AddressCollection::class, $results); $this->assertCount(5, $results); /** @var YandexAddress $result */ $result = $results->first(); - $this->assertInstanceOf('Geocoder\Provider\Yandex\Model\YandexAddress', $result); + $this->assertInstanceOf(YandexAddress::class, $result); $this->assertEqualsWithDelta(41.01117, $result->getCoordinates()->getLatitude(), 0.01); $this->assertEqualsWithDelta(28.978151, $result->getCoordinates()->getLongitude(), 0.01); $this->assertNotNull($result->getBounds()); @@ -409,7 +409,7 @@ public function testReverseMetroStationToGetName(): void /** @var YandexAddress $result */ $result = $results->first(); - $this->assertInstanceOf('Geocoder\Provider\Yandex\Model\YandexAddress', $result); + $this->assertInstanceOf(YandexAddress::class, $result); $this->assertEquals('other', $result->getPrecision()); $this->assertEquals('метро Озерки', $result->getName()); $this->assertEquals('metro', $result->getKind()); diff --git a/src/Provider/Yandex/composer.json b/src/Provider/Yandex/composer.json index b3a30cde9..17b3400f6 100644 --- a/src/Provider/Yandex/composer.json +++ b/src/Provider/Yandex/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^8.0", "geocoder-php/common-http": "^4.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "provide": { "geocoder-php/provider-implementation": "1.0"