diff --git a/.github/workflows/provider.yml b/.github/workflows/provider.yml index 096ef43..590442d 100644 --- a/.github/workflows/provider.yml +++ b/.github/workflows/provider.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.0', '8.1', '8.2', '8.3'] + php-version: ['8.0', '8.1', '8.2', '8.3', '8.4'] steps: - uses: actions/checkout@v4 - name: Use PHP ${{ matrix.php-version }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 057fa79..c145a90 100644 --- a/CHANGELOG.md +++ b/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/Tests/MaxMindBinaryTest.php b/Tests/MaxMindBinaryTest.php index af87f76..dca752e 100644 --- a/Tests/MaxMindBinaryTest.php +++ b/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/composer.json b/composer.json index e221758..b696b2c 100644 --- a/composer.json +++ b/composer.json @@ -15,14 +15,14 @@ "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" }, "require-dev": { "geocoder-php/provider-integration-tests": "^1.6.3", - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^9.6.11" }, "extra": { "branch-alias": {