From 513dd2b90bc44719525509015706ece2b1a2bace Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Tue, 1 Aug 2017 09:24:07 +0200 Subject: [PATCH 01/35] Use stable requirements (#754) * Use stable requirements * Added changelog --- CHANGELOG.md | 6 ++++++ composer.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77016a4..4e2855d 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.0.1 + +### Changed + +- Using stable requirement of `willdurand/geocoder`. + ## 4.0.0 First release of this library. diff --git a/composer.json b/composer.json index 5fbf720..536cc39 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^7.0", "psr/simple-cache": "^1.0", - "willdurand/geocoder": "^4.0.0-beta2" + "willdurand/geocoder": "^4.0.0" }, "require-dev": { "phpunit/phpunit": "^6.1" From 3055b05720d12e909daaf4554b61f6ce3ae5fa13 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 16 Sep 2017 11:58:23 +0200 Subject: [PATCH 02/35] Adding `"prefer-stable": true` on all composer.json --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 536cc39..50f421b 100644 --- a/composer.json +++ b/composer.json @@ -33,6 +33,7 @@ "test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml" }, "minimum-stability": "dev", + "prefer-stable": true, "extra": { "branch-alias": { "dev-master": "4.0-dev" From b24838b49711277f9eaa8da3233024627cc069e9 Mon Sep 17 00:00:00 2001 From: Tim Bond Date: Thu, 15 Mar 2018 13:31:27 -0700 Subject: [PATCH 03/35] Make ProviderCache not final (#837) --- CHANGELOG.md | 4 ++++ ProviderCache.php | 16 ++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e2855d..76969c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.1.0 (2018-03-16) + +* Changed: `ProviderCache` is no longer final allowing `ProviderCache::getCacheKey` to be overridden + ## 4.0.1 ### Changed diff --git a/ProviderCache.php b/ProviderCache.php index afbf956..00fa53b 100644 --- a/ProviderCache.php +++ b/ProviderCache.php @@ -26,26 +26,26 @@ final class ProviderCache implements Provider /** * @var Provider */ - private $realProvider; + protected $realProvider; /** * @var CacheInterface */ - private $cache; + protected $cache; /** * How log a result is going to be cached. * * @var int|null */ - private $lifetime; + protected $lifetime; /** * @param Provider $realProvider * @param CacheInterface $cache * @param int $lifetime */ - public function __construct(Provider $realProvider, CacheInterface $cache, int $lifetime = null) + final public function __construct(Provider $realProvider, CacheInterface $cache, int $lifetime = null) { $this->realProvider = $realProvider; $this->cache = $cache; @@ -55,7 +55,7 @@ public function __construct(Provider $realProvider, CacheInterface $cache, int $ /** * {@inheritdoc} */ - public function geocodeQuery(GeocodeQuery $query): Collection + final public function geocodeQuery(GeocodeQuery $query): Collection { $cacheKey = $this->getCacheKey($query); if (null !== $result = $this->cache->get($cacheKey)) { @@ -71,7 +71,7 @@ public function geocodeQuery(GeocodeQuery $query): Collection /** * {@inheritdoc} */ - public function reverseQuery(ReverseQuery $query): Collection + final public function reverseQuery(ReverseQuery $query): Collection { $cacheKey = $this->getCacheKey($query); if (null !== $result = $this->cache->get($cacheKey)) { @@ -92,7 +92,7 @@ public function getName(): string return sprintf('%s (cache)', $this->realProvider->getName()); } - public function __call($method, $args) + final public function __call($method, $args) { return call_user_func_array([$this->realProvider, $method], $args); } @@ -102,7 +102,7 @@ public function __call($method, $args) * * @return string */ - private function getCacheKey($query): string + protected function getCacheKey($query): string { // Include the major version number of the geocoder to avoid issues unserializing. return 'v4'.sha1((string) $query); From ffb25e509cdbacbdc924423bfc88a1e4abd3117f Mon Sep 17 00:00:00 2001 From: Tim Bond Date: Fri, 16 Mar 2018 09:54:40 -0700 Subject: [PATCH 04/35] Make ProviderCache class not final (#838) --- ProviderCache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProviderCache.php b/ProviderCache.php index 00fa53b..0fd0278 100644 --- a/ProviderCache.php +++ b/ProviderCache.php @@ -21,7 +21,7 @@ /** * @author Tobias Nyholm */ -final class ProviderCache implements Provider +class ProviderCache implements Provider { /** * @var Provider From 2c32e995ac456ebe5be1321229b0aec019ca5bdb Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 15 Sep 2018 01:48:17 -0700 Subject: [PATCH 05/35] Use PHP 7.2 on travis (#889) --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 96ffe28..d855704 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: php sudo: false -php: 7.0 +php: 7.2 install: - composer update --prefer-stable --prefer-dist From cbb24f1d9b15d0ed0ce0c60264d2c87f84f866ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20Nork=C5=ABnas?= Date: Wed, 19 Dec 2018 14:59:30 +0200 Subject: [PATCH 06/35] Tiny typo fix (#921) --- ProviderCache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProviderCache.php b/ProviderCache.php index 0fd0278..9c82ce1 100644 --- a/ProviderCache.php +++ b/ProviderCache.php @@ -34,7 +34,7 @@ class ProviderCache implements Provider protected $cache; /** - * How log a result is going to be cached. + * How long a result is going to be cached. * * @var int|null */ From 0938fcf7a4ca453a9dc41da3756fc13b23b48bee Mon Sep 17 00:00:00 2001 From: atymic <50683531+atymic@users.noreply.github.com> Date: Sun, 21 Jul 2019 23:00:39 +1000 Subject: [PATCH 07/35] chore: add cache provider docs (#977) --- Readme.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Readme.md b/Readme.md index 20cdf06..fad7cf0 100644 --- a/Readme.md +++ b/Readme.md @@ -16,6 +16,33 @@ This is the a cache provider from the PHP Geocoder. This is a **READ ONLY** repo composer require geocoder-php/cache-provider ``` +### Usage +The `ProviderCache` allows you to use any [PSR-6](https://www.php-fig.org/psr/psr-6/) compatible cache driver. +You can find compatible drivers on [packagist](https://packagist.org/providers/psr/cache-implementation). + +By default, the result is cached forever. +You can set a cache expiry by passing an integer representing the number of seconds as the third parameter. + +```php +$httpClient = new \Http\Adapter\Guzzle6\Client(); +$provider = new \Geocoder\Provider\GoogleMaps\GoogleMaps($httpClient); + +$psr6Cache = new ArrayCachePool(); // Requires `cache/array-adapter` package + +$cachedProvider = new \Geocoder\Provider\Cache\ProviderCache( + $provider, // Provider to cache + $psr6Cache, // PSR-6 compatible cache + 600 // Cache expiry, in seconds +); + +$geocoder = new \Geocoder\StatefulGeocoder($cachedProvider, 'en'); + +// Will come from Google Maps API +$result1 = $geocoder->geocodeQuery(GeocodeQuery::create('Buckingham Palace, London')); +// Will come from the cache +$result2 = $geocoder->geocodeQuery(GeocodeQuery::create('Buckingham Palace, London')); +``` + ### Contribute Contributions are very welcome! Send a pull request to the [main repository](https://github.com/geocoder-php/Geocoder) or From 68d976a3eccb11a8a64cbc25497dd970cd55395e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Sat, 4 Jul 2020 10:05:10 +0200 Subject: [PATCH 08/35] Drop support for PHP 7.0 and PHP 7.1 (End of life) (#1068) * Drop support for PHP < 7.2 in composer.json * Update .travis.yml Drop PHP 7.0 abd 7.1 Add PHP 7.4 * Normalize composer.json files Using composer-normalize * Normalize composer.json files (1) Using composer-normalize * Fix TomTom testReverseError400 - Will return JSON instead of XML ; - If API error, returns empty address collection ; * Apply fixes from StyleCI * Upgrade to PHPUnit 7 + Upgrade `nyholm/psr7` * Normalize providers Travis config --- .travis.yml | 2 +- composer.json | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index d855704..7e91c31 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ sudo: false php: 7.2 install: - - composer update --prefer-stable --prefer-dist + - composer update --prefer-stable --prefer-dist script: - composer test-ci diff --git a/composer.json b/composer.json index 50f421b..abcd0cf 100644 --- a/composer.json +++ b/composer.json @@ -12,31 +12,33 @@ } ], "require": { - "php": "^7.0", + "php": "^7.2", "psr/simple-cache": "^1.0", "willdurand/geocoder": "^4.0.0" }, + "provide": { + "geocoder-php/provider-implementation": "1.0" + }, "require-dev": { "phpunit/phpunit": "^6.1" }, - "provide": { - "geocoder-php/provider-implementation": "1.0" + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } }, "autoload": { - "psr-4": { "Geocoder\\Provider\\Cache\\": "" }, + "psr-4": { + "Geocoder\\Provider\\Cache\\": "" + }, "exclude-from-classmap": [ "/Tests/" ] }, + "minimum-stability": "dev", + "prefer-stable": true, "scripts": { "test": "vendor/bin/phpunit", "test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml" - }, - "minimum-stability": "dev", - "prefer-stable": true, - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } } -} +} \ No newline at end of file From 4d737fc5b58bc2880acc30aa1cac79a47b9cae75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Sat, 4 Jul 2020 11:17:42 +0200 Subject: [PATCH 09/35] Remove deprecated `sudo` key in Travis CI config files. (#1072) See https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7e91c31..251286c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ language: php -sudo: false php: 7.2 From 879ac92f5302e922b4d8031b2aa99987efb3d47b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Sat, 4 Jul 2020 15:18:10 +0200 Subject: [PATCH 10/35] Update CHANGELOG for new minor releases (#1074) --- CHANGELOG.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 76969c0..1fd20e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,17 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. -## 4.1.0 (2018-03-16) +## 4.2.0 -* Changed: `ProviderCache` is no longer final allowing `ProviderCache::getCacheKey` to be overridden +### Removed + +- Drop support for PHP < 7.2 + +## 4.1.0 + +### Changed + +- `ProviderCache` is no longer final allowing `ProviderCache::getCacheKey` to be overridden ## 4.0.1 From dfa9bf87d6a1dff78585a5e9a3958e224c845de6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Sat, 19 Dec 2020 10:41:04 +0100 Subject: [PATCH 11/35] Enable PHP 8.0 support (#1102) * Enable PHP 8.0 support * Add GitHub Actions * Upgrade php-http/curl-client + php-http/httplug * Upgrade PHPUnit * Drop PHP 7.2 support * Update GitHub Actions Remove PHP 7.2 * Update Travis CI Remove PHP 7.2 * Drop PHP 7.2 support --- Tests/ProviderCacheTest.php | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/ProviderCacheTest.php b/Tests/ProviderCacheTest.php index 1aa66cc..17d6937 100644 --- a/Tests/ProviderCacheTest.php +++ b/Tests/ProviderCacheTest.php @@ -36,7 +36,7 @@ class ProviderCacheTest extends TestCase */ private $cacheMock; - protected function setUp() + protected function setUp(): void { parent::setUp(); diff --git a/composer.json b/composer.json index abcd0cf..1af5a37 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "php": "^7.2", + "php": "^7.3 || ^8.0", "psr/simple-cache": "^1.0", "willdurand/geocoder": "^4.0.0" }, From e7d1c9ebe295c83c0832225d0fce754465c81959 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Mon, 21 Dec 2020 10:30:01 +0100 Subject: [PATCH 12/35] Enable PHP 8.0 support (1) (#1103) * Upragde PHPUnit * Upgrade PHPUnit configuration * Upgrade Travis CI configuration * Update changelogs --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 1af5a37..77a2aab 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "geocoder-php/provider-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "^6.1" + "phpunit/phpunit": "^9.5" }, "extra": { "branch-alias": { From c1b8a66ffa3df249cd25984a46db60c4a40b20b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Mon, 21 Dec 2020 15:03:32 +0100 Subject: [PATCH 13/35] Enable PHP 8.0 support (2) (#1104) --- phpunit.xml.dist | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 61ffe46..963a4f5 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,25 +1,17 @@ - - - - - - ./Tests/ - - - - - - ./ - - ./Tests - ./vendor - - - + + + + ./ + + + ./Tests + ./vendor + + + + + ./Tests/ + + From 58f4800aea8c1fa50a2ce6869721c4455eba7b30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Mon, 21 Dec 2020 17:40:58 +0100 Subject: [PATCH 14/35] Update Travis CI for all providers --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 251286c..1752e6f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,11 @@ language: php -php: 7.2 +matrix: + fast_finish: true + include: + - php: 7.3 + - php: 7.4 + - php: 8.0 install: - composer update --prefer-stable --prefer-dist From d546423dc3ede4c897bd69b01e26f427fe5558ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Mon, 21 Dec 2020 17:41:18 +0100 Subject: [PATCH 15/35] Update changelog for all providers --- CHANGELOG.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fd20e9..2e96133 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,20 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.3.0 + +### Added + +- Add support for PHP 8.0 + +### Removed + +- Drop support for PHP 7.2 + +### Changed + +- Upgrade PHPUnit to version 9 + ## 4.2.0 ### Removed @@ -22,4 +36,4 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee ## 4.0.0 -First release of this library. +First release of this library. From 7f4b09bdd62cd59756dd4330f55c7405e2ffb703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Sun, 20 Jun 2021 15:32:03 +0200 Subject: [PATCH 16/35] Add GitHub Actions (#1101) * Add GitHub Actions * Update GitHub Actions * Add low/high dependencies * Update low/high dependencies * Disable fail fast See https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast * Update GitHub Actions * Update GitHub Action name * Create provider.yml * Create component.yml * Update component.yml * Update provider.yml * Update component.yml * Update GitHub Action name * Update component.yml * Split tests with ext-geoip + Disable test for deprecated providers * Update provider.yml GeoIP extensions is not (yet?) available for PHP 8.0. * Update provider.yml Disable test for IP2LocationBinary because it needs binary file. Travis CI test has also never passed. * Update provider.yml Use `composer update` insted of `composer install`. * Update provider.yml Use `composer update` insted of `composer install`. * Update README.md * Delete .travis.yml * Delete .travis.yml for providers * Add GitHub Actions workflow for providers * Update provider.yml (Geoip) * Delete .travis.yml for components * Add GitHub Actions workflow for components --- .github/workflows/provider.yml | 33 +++++++++++++++++++++++++++++++++ .travis.yml | 18 ------------------ 2 files changed, 33 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/provider.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/provider.yml b/.github/workflows/provider.yml new file mode 100644 index 0000000..9a09361 --- /dev/null +++ b/.github/workflows/provider.yml @@ -0,0 +1,33 @@ +name: Provider + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + test: + name: PHP ${{ matrix.php-version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php-version: ['7.3', '7.4', '8.0'] + steps: + - uses: actions/checkout@v2 + - name: Use PHP ${{ matrix.php-version }} + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + extensions: curl + - name: Validate composer.json and composer.lock + run: composer validate --strict + - name: Install dependencies + run: composer update --prefer-stable --prefer-dist --no-progress + - name: Run test suite + run: composer run-script test-ci + - name: Upload Coverage report + run: | + wget https://scrutinizer-ci.com/ocular.phar + php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 1752e6f..0000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: php - -matrix: - fast_finish: true - include: - - php: 7.3 - - php: 7.4 - - php: 8.0 - -install: - - composer update --prefer-stable --prefer-dist - -script: - - composer test-ci - -after_success: - - wget https://scrutinizer-ci.com/ocular.phar - - php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml From 633b69ee4b27a2b2b0a8b977ca30eb1765f5143e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Fri, 7 Jan 2022 15:34:12 +0100 Subject: [PATCH 17/35] Add PHP 8.1 to GitHub Actions workflows --- .github/workflows/provider.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/provider.yml b/.github/workflows/provider.yml index 9a09361..efd8c9e 100644 --- a/.github/workflows/provider.yml +++ b/.github/workflows/provider.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['7.3', '7.4', '8.0'] + php-version: ['7.3', '7.4', '8.0', '8.1'] steps: - uses: actions/checkout@v2 - name: Use PHP ${{ matrix.php-version }} From ce1bdb391c720c4517d25f42552ad664b8959679 Mon Sep 17 00:00:00 2001 From: Tobias Sette Date: Sat, 30 Jul 2022 06:33:10 -0300 Subject: [PATCH 18/35] chore: allow psr/simple-cache v2 or v3 (#1150) * chore: allow psr/simple-cache v2 or v3 Co-authored-by: Ruud Kamphuis --- Tests/ProviderCacheTest.php | 4 ++-- composer.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Tests/ProviderCacheTest.php b/Tests/ProviderCacheTest.php index 17d6937..cefe544 100644 --- a/Tests/ProviderCacheTest.php +++ b/Tests/ProviderCacheTest.php @@ -83,7 +83,7 @@ public function testGeocodeMiss() $this->cacheMock->expects($this->once()) ->method('set') ->with($this->anything(), $result, $ttl) - ->willReturn(null); + ->willReturn(true); $this->providerMock->expects($this->once()) ->method('geocodeQuery') @@ -127,7 +127,7 @@ public function testReverseMiss() $this->cacheMock->expects($this->once()) ->method('set') ->with($this->anything(), $result, $ttl) - ->willReturn(null); + ->willReturn(true); $this->providerMock->expects($this->once()) ->method('reverseQuery') diff --git a/composer.json b/composer.json index 77a2aab..7e72f07 100644 --- a/composer.json +++ b/composer.json @@ -13,7 +13,7 @@ ], "require": { "php": "^7.3 || ^8.0", - "psr/simple-cache": "^1.0", + "psr/simple-cache": "^1.0|^2.0|^3.0", "willdurand/geocoder": "^4.0.0" }, "provide": { @@ -41,4 +41,4 @@ "test": "vendor/bin/phpunit", "test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml" } -} \ No newline at end of file +} From 4a8a98b29fa7befa16458f9dc78c9b23a2bde617 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Sat, 30 Jul 2022 12:36:58 +0200 Subject: [PATCH 19/35] Drop support for PHP 7.3 (#1158) * Update compser.json files * Update GitHub Actions workflows * Update CHANGELOG.md * Update php.yml --- .github/workflows/provider.yml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/provider.yml b/.github/workflows/provider.yml index efd8c9e..93c21df 100644 --- a/.github/workflows/provider.yml +++ b/.github/workflows/provider.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['7.3', '7.4', '8.0', '8.1'] + php-version: ['7.4', '8.0', '8.1'] steps: - uses: actions/checkout@v2 - name: Use PHP ${{ matrix.php-version }} diff --git a/composer.json b/composer.json index 7e72f07..8414972 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "php": "^7.3 || ^8.0", + "php": "^7.4 || ^8.0", "psr/simple-cache": "^1.0|^2.0|^3.0", "willdurand/geocoder": "^4.0.0" }, From 33272c39717cc58ec39480024de642de70dfe70e Mon Sep 17 00:00:00 2001 From: Jasper Zonneveld Date: Sat, 30 Jul 2022 12:48:32 +0200 Subject: [PATCH 20/35] Expect a PSR-18 client instead of a PHP-HTTP client (#1110) * Expect a PSR-18 client instead of a PHP-HTTP client * Update integration tests --- Readme.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Readme.md b/Readme.md index fad7cf0..16f0e08 100644 --- a/Readme.md +++ b/Readme.md @@ -8,7 +8,7 @@ [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) This is the a cache 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. +[main repo](https://github.com/geocoder-php/Geocoder) for information and documentation. ### Install @@ -20,11 +20,11 @@ composer require geocoder-php/cache-provider The `ProviderCache` allows you to use any [PSR-6](https://www.php-fig.org/psr/psr-6/) compatible cache driver. You can find compatible drivers on [packagist](https://packagist.org/providers/psr/cache-implementation). -By default, the result is cached forever. +By default, the result is cached forever. You can set a cache expiry by passing an integer representing the number of seconds as the third parameter. ```php -$httpClient = new \Http\Adapter\Guzzle6\Client(); +$httpClient = new \GuzzleHttp\Client(); $provider = new \Geocoder\Provider\GoogleMaps\GoogleMaps($httpClient); $psr6Cache = new ArrayCachePool(); // Requires `cache/array-adapter` package @@ -45,5 +45,5 @@ $result2 = $geocoder->geocodeQuery(GeocodeQuery::create('Buckingham Palace, Lond ### Contribute -Contributions are very welcome! Send a pull request to the [main repository](https://github.com/geocoder-php/Geocoder) or +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). From 3a1f99bdb4224701a2fd81f942ddc50adb60ff35 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Sat, 30 Jul 2022 14:09:30 +0200 Subject: [PATCH 21/35] Update CHANGELOG.md for all providers (#1159) * Update CHANGELOG.md for all providers * [common-http] Update CHANGELOG.md * [plugin] Update CHANGELOG.md * [MapTiler] Update CHANGELOG.md --- CHANGELOG.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e96133..6c0610a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.4.0 + +### Added + +- Add support for PHP 8.1 +- Allow `psr/simple-cache` 2.0 and 3.0 +- Add GitHub Actions workflow + +### Removed + +- Drop support for PHP 7.3 + +### Changed + +- Migrate from PHP-HTTP to PSR-18 client + ## 4.3.0 ### Added From 404d684af5413de6572f019886876568cf4cb10f Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 5 Jan 2023 15:02:12 +0100 Subject: [PATCH 22/35] chore: components and plugins, add ci tests for php 8.2 (#1171) chore: components and plugins, add ci tests for php 8.2, bump github actions versions Co-authored-by: Christopher Georg --- .github/workflows/provider.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/provider.yml b/.github/workflows/provider.yml index 93c21df..6c837b2 100644 --- a/.github/workflows/provider.yml +++ b/.github/workflows/provider.yml @@ -13,9 +13,9 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['7.4', '8.0', '8.1'] + php-version: ['7.4', '8.0', '8.1', '8.2'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Use PHP ${{ matrix.php-version }} uses: shivammathur/setup-php@v2 with: @@ -30,4 +30,4 @@ jobs: - name: Upload Coverage report run: | wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml \ No newline at end of file + php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml From bcfb50fc1dceb8dcc3da1c44ac910d13e06a2218 Mon Sep 17 00:00:00 2001 From: Antoine Lemaire Date: Fri, 30 Jun 2023 18:13:04 +0200 Subject: [PATCH 23/35] ProviderCache: Add option to separate cache between providers (#1045) Add option to separate cache --- ProviderCache.php | 13 ++++++++++--- Tests/ProviderCacheTest.php | 29 +++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/ProviderCache.php b/ProviderCache.php index 9c82ce1..b2de362 100644 --- a/ProviderCache.php +++ b/ProviderCache.php @@ -40,16 +40,22 @@ class ProviderCache implements Provider */ protected $lifetime; + /** + * If true, include the real provider name into the cache key + */ + private bool $separateCache; + /** * @param Provider $realProvider * @param CacheInterface $cache * @param int $lifetime */ - final public function __construct(Provider $realProvider, CacheInterface $cache, int $lifetime = null) + final public function __construct(Provider $realProvider, CacheInterface $cache, int $lifetime = null, bool $separateCache = false) { $this->realProvider = $realProvider; $this->cache = $cache; $this->lifetime = $lifetime; + $this->separateCache = $separateCache; } /** @@ -104,7 +110,8 @@ final public function __call($method, $args) */ protected function getCacheKey($query): string { - // Include the major version number of the geocoder to avoid issues unserializing. - return 'v4'.sha1((string) $query); + // Include the major version number of the geocoder to avoid issues unserializing + // and real provider name if we want to separate cache + return 'v4'.sha1((string) $query.($this->separateCache ? $this->realProvider->getName() : '')); } } diff --git a/Tests/ProviderCacheTest.php b/Tests/ProviderCacheTest.php index cefe544..9b1c355 100644 --- a/Tests/ProviderCacheTest.php +++ b/Tests/ProviderCacheTest.php @@ -157,4 +157,33 @@ public function testReverseHit() $providerCache = new ProviderCache($this->providerMock, $this->cacheMock, $ttl); $providerCache->reverseQuery($query); } + + public function testCacheSeparation() + { + $query = GeocodeQuery::create('foo'); + $ttl = 4711; + + $this->providerMock->expects($this->any()) + ->method('getName') + ->willReturn('foo'); + + $getCacheKey = self::getMethod('getCacheKey'); + + $providerCache = new ProviderCache($this->providerMock, $this->cacheMock, $ttl); + $providerCacheWithSeparation = new ProviderCache($this->providerMock, $this->cacheMock, $ttl, true); + + $this->assertNotEquals( + $getCacheKey->invokeArgs($providerCache, [$query]), + $getCacheKey->invokeArgs($providerCacheWithSeparation, [$query]) + ); + } + + protected static function getMethod($name) + { + $class = new \ReflectionClass(ProviderCache::class); + $method = $class->getMethod($name); + $method->setAccessible(true); + + return $method; + } } From ced6d18e8d0ed918ba8f01fe3ed9a328b82e352f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Sun, 16 Jul 2023 16:36:39 +0200 Subject: [PATCH 24/35] Add PHPStan in CI (#1193) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add PHPStan * Update php.yml * Update composer.json * Fix PHPStan level 0 * Fix PHPStan level 1 * Update phpstan.neon * Fix PHPStan level 2 * Update composer.json * Fix PHPStan level 3 * Fix tests * Fix PHPStan level 4 * Update src/Common/Tests/TimedGeocoderTest.php Co-authored-by: Tomas Norkūnas * Update src/Provider/Cache/Tests/ProviderCacheTest.php Co-authored-by: Tomas Norkūnas * Update src/Provider/Cache/Tests/ProviderCacheTest.php Co-authored-by: Tomas Norkūnas * Update src/Provider/GeoIP2/Tests/GeoIP2Test.php Co-authored-by: Tomas Norkūnas * Fix PHPStan level 5 * Normalize composer.json * Rename analyse script * Update composer.json * Update IntegrationTest * Update AlgoliaPlacesTest * Update composer.json * Update RequestInterface vs. getParsedResponse() * Update src/Plugin/PluginProvider.php Co-authored-by: Tomas Norkūnas * Update src/Plugin/PluginProvider.php Co-authored-by: Tomas Norkūnas * Use PHPStan baseline instead of ignore See https://phpstan.org/user-guide/baseline --------- Co-authored-by: Tomas Norkūnas --- Tests/ProviderCacheTest.php | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/Tests/ProviderCacheTest.php b/Tests/ProviderCacheTest.php index 9b1c355..cec3f6e 100644 --- a/Tests/ProviderCacheTest.php +++ b/Tests/ProviderCacheTest.php @@ -18,6 +18,7 @@ use Geocoder\Provider\Provider; use Geocoder\Query\GeocodeQuery; use Geocoder\Query\ReverseQuery; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Psr\SimpleCache\CacheInterface; @@ -27,12 +28,12 @@ class ProviderCacheTest extends TestCase { /** - * @var \PHPUnit_Framework_MockObject_MockObject|Provider + * @var Provider&MockObject */ private $providerMock; /** - * @var \PHPUnit_Framework_MockObject_MockObject|CacheInterface + * @var CacheInterface&MockObject */ private $cacheMock; @@ -60,16 +61,6 @@ public function testName() $this->assertEquals('foo (cache)', $providerCache->getName()); } - public function testMagicFunction() - { - $this->providerMock->expects($this->once()) - ->method('getFoo') - ->willReturn('foo'); - - $providerCache = new ProviderCache($this->providerMock, $this->cacheMock); - $this->assertEquals('foo', $providerCache->getFoo()); - } - public function testGeocodeMiss() { $query = GeocodeQuery::create('foo'); From bd3df1717553ecc5e206ca7e25735dd5bdfcb772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Fri, 21 Jul 2023 11:32:47 +0200 Subject: [PATCH 25/35] Add PHP Coding Standards Fixer in CI (#1196) * Update composer.json * Update .gitignore * Update php.yml * Apply PHPCSFixer fixes * Switch to php-cs-fixer/shim * Create .php-cs-fixer.dist.php --- ProviderCache.php | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/ProviderCache.php b/ProviderCache.php index b2de362..c9f50df 100644 --- a/ProviderCache.php +++ b/ProviderCache.php @@ -13,9 +13,9 @@ namespace Geocoder\Provider\Cache; use Geocoder\Collection; +use Geocoder\Provider\Provider; use Geocoder\Query\GeocodeQuery; use Geocoder\Query\ReverseQuery; -use Geocoder\Provider\Provider; use Psr\SimpleCache\CacheInterface; /** @@ -41,14 +41,12 @@ class ProviderCache implements Provider protected $lifetime; /** - * If true, include the real provider name into the cache key + * If true, include the real provider name into the cache key. */ private bool $separateCache; /** - * @param Provider $realProvider - * @param CacheInterface $cache - * @param int $lifetime + * @param int $lifetime */ final public function __construct(Provider $realProvider, CacheInterface $cache, int $lifetime = null, bool $separateCache = false) { @@ -58,9 +56,6 @@ final public function __construct(Provider $realProvider, CacheInterface $cache, $this->separateCache = $separateCache; } - /** - * {@inheritdoc} - */ final public function geocodeQuery(GeocodeQuery $query): Collection { $cacheKey = $this->getCacheKey($query); @@ -74,9 +69,6 @@ final public function geocodeQuery(GeocodeQuery $query): Collection return $result; } - /** - * {@inheritdoc} - */ final public function reverseQuery(ReverseQuery $query): Collection { $cacheKey = $this->getCacheKey($query); @@ -90,9 +82,6 @@ final public function reverseQuery(ReverseQuery $query): Collection return $result; } - /** - * {@inheritdoc} - */ public function getName(): string { return sprintf('%s (cache)', $this->realProvider->getName()); @@ -105,8 +94,6 @@ final public function __call($method, $args) /** * @param GeocodeQuery|ReverseQuery $query - * - * @return string */ protected function getCacheKey($query): string { From 53d1e3f35c1e865723ed0512183c7ae91dff4eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Mon, 31 Jul 2023 21:52:23 +0200 Subject: [PATCH 26/35] Drop support for PHP 7.4 (#1197) * Remove PHP 7.4 * Remove remaining .travis.yml * Update CI for GeoIP * Deprecate Geoip provider geoip extension doesn't seem to be available in PHP 8. --- .github/workflows/provider.yml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/provider.yml b/.github/workflows/provider.yml index 6c837b2..d7fbb64 100644 --- a/.github/workflows/provider.yml +++ b/.github/workflows/provider.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['7.4', '8.0', '8.1', '8.2'] + php-version: ['8.0', '8.1', '8.2'] steps: - uses: actions/checkout@v3 - name: Use PHP ${{ matrix.php-version }} diff --git a/composer.json b/composer.json index 8414972..cd9e28e 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ } ], "require": { - "php": "^7.4 || ^8.0", + "php": "^8.0", "psr/simple-cache": "^1.0|^2.0|^3.0", "willdurand/geocoder": "^4.0.0" }, From 8b5ec26cb2ce858f29d8b4dc5947343ba5a65e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Mon, 31 Jul 2023 22:07:24 +0200 Subject: [PATCH 27/35] Enable PHPStan Level 6 (#1194) * Update phpstan.neon * Update YandexTest.php * Update TomTomTest.php * Update PickPointTest.php * Update PickPoint.php * Update PhotonTest.php * Update PeliasTest.php * Update OpenRouteServiceTest.php * Update OpenCageTest.php * Update OpenCage.php * Update NominatimTest.php * Update MaxMindBinaryTest.php * Update MaxMindTest.php * [WIP] Apply PHPStan fixes * Apply PHPCSFixer fixes * [WIP] Apply PHPStan fixes * [WIP] Apply PHPStan fixes * Revert "[WIP] Apply PHPStan fixes" This reverts commit 734c5c52fbcba4bc12cbda07b58d902a79d47891. * [WIP] Apply PHPStan fixes * [WIP] Apply PHPStan fixes * Update phpstan-baseline.neon --- ProviderCache.php | 2 +- Tests/ProviderCacheTest.php | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ProviderCache.php b/ProviderCache.php index c9f50df..c868f65 100644 --- a/ProviderCache.php +++ b/ProviderCache.php @@ -87,7 +87,7 @@ public function getName(): string return sprintf('%s (cache)', $this->realProvider->getName()); } - final public function __call($method, $args) + final public function __call(string $method, array $args): mixed { return call_user_func_array([$this->realProvider, $method], $args); } diff --git a/Tests/ProviderCacheTest.php b/Tests/ProviderCacheTest.php index cec3f6e..47b95b0 100644 --- a/Tests/ProviderCacheTest.php +++ b/Tests/ProviderCacheTest.php @@ -51,7 +51,7 @@ protected function setUp(): void ->getMock(); } - public function testName() + public function testName(): void { $this->providerMock->expects($this->once()) ->method('getName') @@ -61,7 +61,7 @@ public function testName() $this->assertEquals('foo (cache)', $providerCache->getName()); } - public function testGeocodeMiss() + public function testGeocodeMiss(): void { $query = GeocodeQuery::create('foo'); $result = new AddressCollection([Address::createFromArray([])]); @@ -85,7 +85,7 @@ public function testGeocodeMiss() $providerCache->geocodeQuery($query); } - public function testGeocodeHit() + public function testGeocodeHit(): void { $query = GeocodeQuery::create('foo'); $result = new AddressCollection([Address::createFromArray([])]); @@ -105,7 +105,7 @@ public function testGeocodeHit() $providerCache->geocodeQuery($query); } - public function testReverseMiss() + public function testReverseMiss(): void { $query = ReverseQuery::fromCoordinates(1, 2); $result = new AddressCollection([Address::createFromArray([])]); @@ -129,7 +129,7 @@ public function testReverseMiss() $providerCache->reverseQuery($query); } - public function testReverseHit() + public function testReverseHit(): void { $query = ReverseQuery::fromCoordinates(1, 2); $result = new AddressCollection([Address::createFromArray([])]); @@ -149,7 +149,7 @@ public function testReverseHit() $providerCache->reverseQuery($query); } - public function testCacheSeparation() + public function testCacheSeparation(): void { $query = GeocodeQuery::create('foo'); $ttl = 4711; @@ -169,7 +169,7 @@ public function testCacheSeparation() ); } - protected static function getMethod($name) + protected static function getMethod(string $name): \ReflectionMethod { $class = new \ReflectionClass(ProviderCache::class); $method = $class->getMethod($name); From f90e2d0675671542071451a6188adc5e0091adb6 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 15 Dec 2023 17:28:59 +0100 Subject: [PATCH 28/35] Replace HTTPlug factories by PSR-17 (#1184) * Replace HTTPlug factories by PSR-17 * minor fix --------- Co-authored-by: Nyholm --- ProviderCache.php | 3 --- Readme.md | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/ProviderCache.php b/ProviderCache.php index c868f65..de8cacd 100644 --- a/ProviderCache.php +++ b/ProviderCache.php @@ -45,9 +45,6 @@ class ProviderCache implements Provider */ private bool $separateCache; - /** - * @param int $lifetime - */ final public function __construct(Provider $realProvider, CacheInterface $cache, int $lifetime = null, bool $separateCache = false) { $this->realProvider = $realProvider; diff --git a/Readme.md b/Readme.md index 16f0e08..0f6f0f4 100644 --- a/Readme.md +++ b/Readme.md @@ -24,7 +24,7 @@ By default, the result is cached forever. You can set a cache expiry by passing an integer representing the number of seconds as the third parameter. ```php -$httpClient = new \GuzzleHttp\Client(); +$httpClient = new \Http\Discovery\Psr18Client(); $provider = new \Geocoder\Provider\GoogleMaps\GoogleMaps($httpClient); $psr6Cache = new ArrayCachePool(); // Requires `cache/array-adapter` package From 514a3c2d720e181e39e01623669b4fdb40ff5d3f Mon Sep 17 00:00:00 2001 From: chris Date: Sat, 2 Mar 2024 11:52:31 +0100 Subject: [PATCH 29/35] chore: bump github action "actions/checkout" 3 => 4 to fix deprecations (#1216) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Christopher Georg Co-authored-by: Jonathan Beliën --- .github/workflows/provider.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/provider.yml b/.github/workflows/provider.yml index d7fbb64..1e1349c 100644 --- a/.github/workflows/provider.yml +++ b/.github/workflows/provider.yml @@ -15,7 +15,7 @@ jobs: matrix: php-version: ['8.0', '8.1', '8.2'] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Use PHP ${{ matrix.php-version }} uses: shivammathur/setup-php@v2 with: From dfb4f1cfcc2d338d87bbdde9b5549c4fdbdcb41f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Sat, 2 Mar 2024 12:00:56 +0100 Subject: [PATCH 30/35] =?UTF-8?q?=F0=9F=9A=A8=20Apply=20PHP=20CS=20Fixer?= =?UTF-8?q?=20fixes=20(#1219)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProviderCache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ProviderCache.php b/ProviderCache.php index de8cacd..512c8c7 100644 --- a/ProviderCache.php +++ b/ProviderCache.php @@ -45,7 +45,7 @@ class ProviderCache implements Provider */ private bool $separateCache; - final public function __construct(Provider $realProvider, CacheInterface $cache, int $lifetime = null, bool $separateCache = false) + final public function __construct(Provider $realProvider, CacheInterface $cache, ?int $lifetime = null, bool $separateCache = false) { $this->realProvider = $realProvider; $this->cache = $cache; From 7a3e3b2a0ba77cf85a6cb47b1c9653b2fa159fdc Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 4 Mar 2024 10:43:01 +0100 Subject: [PATCH 31/35] chore: add testruns for PHP 8.3 (#1222) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Christopher Georg Co-authored-by: Jonathan Beliën --- .github/workflows/provider.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/provider.yml b/.github/workflows/provider.yml index 1e1349c..096ef43 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'] + php-version: ['8.0', '8.1', '8.2', '8.3'] steps: - uses: actions/checkout@v4 - name: Use PHP ${{ matrix.php-version }} From 5d16556fc3641c24964eae68ef12e786d7a4d382 Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 14 Nov 2024 12:27:14 +0100 Subject: [PATCH 32/35] chore: add testruns for PHP 8.4 (#1235) * feat: bump dev dependencies * chore: add testruns for PHP 8.4 * chore: add testruns for PHP 8.4 * chore: add testruns for PHP 8.4 --------- Co-authored-by: Christopher Georg --- .github/workflows/provider.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }} From 15f43e95e8dc9e89f99c4d46f6c3eb116c196b96 Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 11 Feb 2025 11:14:37 +0100 Subject: [PATCH 33/35] feat: allow "willdurand/geocoder" v5 (#1240) Co-authored-by: Christopher Georg Co-authored-by: Tobias Nyholm --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index cd9e28e..8d025a0 100644 --- a/composer.json +++ b/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" From 3b091778426722cf96e166d187bbdd28660635b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Tue, 15 Apr 2025 15:24:32 +0200 Subject: [PATCH 34/35] Update CHANGELOG.md for all providers Prepare new release for PHP Geocoder 5 support. --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c0610a..5422c14 100644 --- a/CHANGELOG.md +++ b/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 From 8a93527102d635dbc93241c7c509cea4bdb70591 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomas=20Nork=C5=ABnas?= Date: Sat, 7 Jun 2025 11:08:41 +0300 Subject: [PATCH 35/35] Resolve some deprecations and remove igorw/get-in dependency (#1257) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove `igorw/get-in` dependency to simplify code * Fix phpunit deprecation * Simplify phpunit's `->will($this->returnValue())` with `->willReturn()` * Simplify phpunit's `->will($this->returnCallback())` with `->willReturnCallback()` * Fix deprecated mock builder `setMethds` with `createPartialMock` * Remove deprecated phpstan `checkGenericClassInNonGenericObjectType` option * Bump phpunit to 9.6 --------- Co-authored-by: Jonathan Beliën --- Tests/ProviderCacheTest.php | 9 ++------- composer.json | 2 +- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/Tests/ProviderCacheTest.php b/Tests/ProviderCacheTest.php index 47b95b0..df179a0 100644 --- a/Tests/ProviderCacheTest.php +++ b/Tests/ProviderCacheTest.php @@ -41,14 +41,9 @@ protected function setUp(): void { parent::setUp(); - $this->cacheMock = $this->getMockBuilder(CacheInterface::class) - ->setMethods(['get', 'set', 'delete', 'clear', 'setMultiple', 'getMultiple', 'deleteMultiple', 'has']) + $this->cacheMock = $this->createPartialMock(CacheInterface::class, ['get', 'set', 'delete', 'clear', 'setMultiple', 'getMultiple', 'deleteMultiple', 'has']); - ->getMock(); - - $this->providerMock = $this->getMockBuilder(Provider::class) - ->setMethods(['getFoo', 'getName', 'geocodeQuery', 'reverseQuery']) - ->getMock(); + $this->providerMock = $this->createPartialMock(Provider::class, ['getName', 'geocodeQuery', 'reverseQuery']); } public function testName(): void diff --git a/composer.json b/composer.json index 8d025a0..ad1331a 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "geocoder-php/provider-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "^9.5" + "phpunit/phpunit": "^9.6.11" }, "extra": { "branch-alias": {