From 8c0bc48cb481fa9322e90103c46d28770a4eb6b8 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 16 Sep 2017 11:58:23 +0200 Subject: [PATCH 01/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 629d907..2f08917 100644 --- a/composer.json +++ b/composer.json @@ -39,6 +39,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 9f710936dbfe77e87820893e3fd6a6efbb398800 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Fri, 6 Oct 2017 09:25:36 -0400 Subject: [PATCH 02/35] Fix phpunit version to 6.3.* This will fix the build error. --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2f08917..bdc0e13 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ "php-http/discovery": "^1.0" }, "require-dev": { - "phpunit/phpunit": "^6.1", + "phpunit/phpunit": "6.3.*", "symfony/stopwatch": "~2.5", "php-http/message": "^1.0", "php-http/mock-client": "^1.0", From a527ed6c59b4527ed768c37f071581cf0ff4e940 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Wed, 11 Apr 2018 19:38:42 +0200 Subject: [PATCH 03/35] Use the latest version of discovery. (#842) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index bdc0e13..3225c2f 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "php-http/message-factory": "^1.0.2", "psr/http-message-implementation": "^1.0", "php-http/client-implementation": "^1.0", - "php-http/discovery": "^1.0" + "php-http/discovery": "^1.4" }, "require-dev": { "phpunit/phpunit": "6.3.*", From 7ea4b9af46eaa6733d70ca6229e8c52cc90612da Mon Sep 17 00:00:00 2001 From: Stadly Date: Wed, 27 Jun 2018 16:24:50 +0200 Subject: [PATCH 04/35] Split getUrlContents (#864) * Split getUrlContents Since `getUrlContents()` takes the url as a string argument, it is not possible to set headers, such as `Accept-Language`, for the request. Therefore I created `getRequest()` to generate the request based on the url string, but without fetching the contents. Then headers can be added to the request, before the request is passed to `getRequestContents()` which fetches the content. * Rename method --- Provider/AbstractHttpProvider.php | 32 ++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/Provider/AbstractHttpProvider.php b/Provider/AbstractHttpProvider.php index 2b2e0aa..e4c173c 100644 --- a/Provider/AbstractHttpProvider.php +++ b/Provider/AbstractHttpProvider.php @@ -19,6 +19,7 @@ use Http\Message\MessageFactory; use Http\Discovery\MessageFactoryDiscovery; use Http\Client\HttpClient; +use Psr\Http\Message\RequestInterface; /** * @author William Durand @@ -57,7 +58,32 @@ public function __construct(HttpClient $client, MessageFactory $factory = null) */ protected function getUrlContents(string $url): string { - $request = $this->getMessageFactory()->createRequest('GET', $url); + $request = $this->getRequest($url); + + return $this->getParsedResponse($request); + } + + /** + * @param string $url + * + * @return RequestInterface + */ + protected function getRequest(string $url): RequestInterface + { + return $this->getMessageFactory()->createRequest('GET', $url); + } + + /** + * Send request and return contents. If content is empty, an exception will be thrown. + * + * @param RequestInterface $request + * + * @return string + * + * @throws InvalidServerResponse + */ + protected function getParsedResponse(RequestInterface $request): string + { $response = $this->getHttpClient()->sendRequest($request); $statusCode = $response->getStatusCode(); @@ -66,12 +92,12 @@ protected function getUrlContents(string $url): string } elseif (429 === $statusCode) { throw new QuotaExceeded(); } elseif ($statusCode >= 300) { - throw InvalidServerResponse::create($url, $statusCode); + throw InvalidServerResponse::create((string) $request->getUri(), $statusCode); } $body = (string) $response->getBody(); if (empty($body)) { - throw InvalidServerResponse::emptyResponse($url); + throw InvalidServerResponse::emptyResponse((string) $request->getUri()); } return $body; From c8eb76a2de8fd51ce418aeb227da23869c1db262 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 28 Jun 2018 11:46:39 +0200 Subject: [PATCH 05/35] Added changelog for 4.1 (#866) --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b0bc815..e918501 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.1.0 + +### Changed + +- Refactored `AbstractHttpProvider::getUrlContents` to split it up to different functions. We now +got `AbstractHttpProvider::getUrlContents`, `AbstractHttpProvider::getRequest` and `AbstractHttpProvider::getParsedResponse`. + ## 4.0.0 No changes since beta 2. From 7cd1630da2c044e3bf51a426c69d66af4d1c24e9 Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 15 Nov 2018 23:27:27 +0100 Subject: [PATCH 06/35] Allow HTTPlug 2.0 (#903) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3225c2f..e10d668 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ "require": { "php": "^7.0", "willdurand/geocoder": "^4.0", - "php-http/httplug": "^1.0", + "php-http/httplug": "^1.0 || ^2.0", "psr/http-message": "^1.0", "php-http/message-factory": "^1.0.2", "psr/http-message-implementation": "^1.0", From c752b62baef07eb746858481f8dae1e64ba4766c Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Sat, 5 Jan 2019 19:19:45 +0100 Subject: [PATCH 07/35] Remove nyholm/psr7 from require-dev (#928) * Remove nyholm/psr7 from require-dev * cs --- .travis.yml | 2 +- Tests/Provider/AbstractHttpProviderTest.php | 6 ------ composer.json | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index d2b93dc..7920b0f 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 diff --git a/Tests/Provider/AbstractHttpProviderTest.php b/Tests/Provider/AbstractHttpProviderTest.php index 4f6d5fe..8a52124 100644 --- a/Tests/Provider/AbstractHttpProviderTest.php +++ b/Tests/Provider/AbstractHttpProviderTest.php @@ -18,17 +18,11 @@ use Geocoder\Query\GeocodeQuery; use Geocoder\Query\ReverseQuery; use Http\Client\HttpClient; -use Http\Discovery\ClassDiscovery; use Http\Mock\Client; use PHPUnit\Framework\TestCase; class AbstractHttpProviderTest extends TestCase { - public static function setUpBeforeClass() - { - ClassDiscovery::prependStrategy('\Nyholm\Psr7\Httplug\DiscoveryStrategy'); - } - public function testHttpClientGetter() { $client = $this->getMockBuilder(Client::class)->disableOriginalConstructor()->getMock(); diff --git a/composer.json b/composer.json index e10d668..a6ee166 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ "symfony/stopwatch": "~2.5", "php-http/message": "^1.0", "php-http/mock-client": "^1.0", - "nyholm/psr7": "^0.2.2" + "nyholm/psr7": "^1.0" }, "autoload": { "psr-4": { "Geocoder\\Http\\": "" }, From 58a750747170e57071b41dcb2817e4f32aea6d3d Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Wed, 6 Feb 2019 13:18:09 +0100 Subject: [PATCH 08/35] Make sure we dont include multiple vendor folders (#934) * Make sure we dont include multiple vendor folders * Require discovery 1.6 --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index a6ee166..f155eb6 100644 --- a/composer.json +++ b/composer.json @@ -19,10 +19,10 @@ "php-http/message-factory": "^1.0.2", "psr/http-message-implementation": "^1.0", "php-http/client-implementation": "^1.0", - "php-http/discovery": "^1.4" + "php-http/discovery": "^1.6" }, "require-dev": { - "phpunit/phpunit": "6.3.*", + "phpunit/phpunit": "^6.5 || ^7.5", "symfony/stopwatch": "~2.5", "php-http/message": "^1.0", "php-http/mock-client": "^1.0", From d5700850ef440766d54d0b3bf3a9655fa3276e1f 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 09/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 | 3 +-- composer.json | 40 ++++++++++++++++++++++------------------ 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7920b0f..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 @@ -12,4 +12,3 @@ script: after_success: - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover build/coverage.xml - diff --git a/composer.json b/composer.json index f155eb6..fe358aa 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,9 @@ "name": "geocoder-php/common-http", "type": "library", "description": "Common files for HTTP based Geocoders", - "keywords": ["http geocoder"], + "keywords": [ + "http geocoder" + ], "homepage": "http://geocoder-php.org", "license": "MIT", "authors": [ @@ -12,37 +14,39 @@ } ], "require": { - "php": "^7.0", - "willdurand/geocoder": "^4.0", + "php": "^7.2", + "php-http/client-implementation": "^1.0", + "php-http/discovery": "^1.6", "php-http/httplug": "^1.0 || ^2.0", - "psr/http-message": "^1.0", "php-http/message-factory": "^1.0.2", + "psr/http-message": "^1.0", "psr/http-message-implementation": "^1.0", - "php-http/client-implementation": "^1.0", - "php-http/discovery": "^1.6" + "willdurand/geocoder": "^4.0" }, "require-dev": { - "phpunit/phpunit": "^6.5 || ^7.5", - "symfony/stopwatch": "~2.5", + "nyholm/psr7": "^1.0", "php-http/message": "^1.0", "php-http/mock-client": "^1.0", - "nyholm/psr7": "^1.0" + "phpunit/phpunit": "^7.5", + "symfony/stopwatch": "~2.5" + }, + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } }, "autoload": { - "psr-4": { "Geocoder\\Http\\": "" }, + "psr-4": { + "Geocoder\\Http\\": "" + }, "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 e9a14a99f16bf78df0aa73c018973f354140b5c0 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 10/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 333505d418b74e0b252eb239575f44291c4121de 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 11/35] Update CHANGELOG for new minor releases (#1074) --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e918501..4e0e4ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.3.0 + +### Removed + +- Drop support for PHP < 7.2 + +## 4.2.0 + ## 4.1.0 ### Changed From 27f5939f7db2b4c4ab46944b1d66e9ac7df85dfa 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 12/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 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index fe358aa..ac59cc1 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "^7.2", + "php": "^7.3 || ^8.0", "php-http/client-implementation": "^1.0", "php-http/discovery": "^1.6", "php-http/httplug": "^1.0 || ^2.0", From b8b6a6848edefe808882378c992b2ad6d4f23a64 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 13/35] Enable PHP 8.0 support (1) (#1103) * Upragde PHPUnit * Upgrade PHPUnit configuration * Upgrade Travis CI configuration * Update changelogs --- .travis.yml | 7 ++++++- CHANGELOG.md | 20 +++++++++++++++++--- composer.json | 2 +- phpunit.xml.dist | 48 ++++++++++++++++++++++-------------------------- 4 files changed, 46 insertions(+), 31 deletions(-) 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e0e4ff..1707b84 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.4.0 + +### Added + +- Add support for PHP 8.0 + +### Removed + +- Drop support for PHP 7.2 + +### Changed + +- Upgrade PHPUnit to version 9 + ## 4.3.0 ### Removed @@ -19,14 +33,14 @@ got `AbstractHttpProvider::getUrlContents`, `AbstractHttpProvider::getRequest` a ## 4.0.0 -No changes since beta 2. +No changes since beta 2. ## 4.0.0-beta2 - Removed `AbstractHttpProvider::setMessageFactory`. - Removed `AbstractHttpProvider::getHttpClient`. -- Make sure we have a `MessageFactory` in the constructor of `AbstractHttpProvider`. +- Make sure we have a `MessageFactory` in the constructor of `AbstractHttpProvider`. ## 4.0.0-beta1 -First release of this library. +First release of this library. diff --git a/composer.json b/composer.json index ac59cc1..24803a0 100644 --- a/composer.json +++ b/composer.json @@ -27,7 +27,7 @@ "nyholm/psr7": "^1.0", "php-http/message": "^1.0", "php-http/mock-client": "^1.0", - "phpunit/phpunit": "^7.5", + "phpunit/phpunit": "^9.5", "symfony/stopwatch": "~2.5" }, "extra": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7581e87..d3ed6e3 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,28 +1,24 @@ - - - - - - - - - ./Tests/ - - - - - - ./ - - ./Tests - ./vendor - - - + + + + ./ + + + ./Tests + ./vendor + + + + + + + + ./Tests/ + + From e4a7353bda8cbc39155c9e267068a5bb982eae1a 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 14/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/component.yml | 33 +++++++++++++++++++++++++++++++++ .travis.yml | 18 ------------------ 2 files changed, 33 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/component.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/component.yml b/.github/workflows/component.yml new file mode 100644 index 0000000..887f865 --- /dev/null +++ b/.github/workflows/component.yml @@ -0,0 +1,33 @@ +name: Component + +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 db813792bf10a87d61c97766c6d1fa330d7763ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Mon, 21 Jun 2021 08:13:22 +0200 Subject: [PATCH 15/35] Replace empty() by more strict checks (#1125) * Replace empty() by stricter checks * Apply StyleCI fixes * Compare with empty string instead of checking length * Compare with empty array instead of checking count * Compare with empty string instead of checking length --- Provider/AbstractHttpProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Provider/AbstractHttpProvider.php b/Provider/AbstractHttpProvider.php index e4c173c..9dcec34 100644 --- a/Provider/AbstractHttpProvider.php +++ b/Provider/AbstractHttpProvider.php @@ -96,7 +96,7 @@ protected function getParsedResponse(RequestInterface $request): string } $body = (string) $response->getBody(); - if (empty($body)) { + if ('' === $body) { throw InvalidServerResponse::emptyResponse((string) $request->getUri()); } From 7e0ef0b0291db7c04cb1229b22e781f0e721c2d5 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 16/35] Add PHP 8.1 to GitHub Actions workflows --- .github/workflows/component.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/component.yml b/.github/workflows/component.yml index 887f865..be89048 100644 --- a/.github/workflows/component.yml +++ b/.github/workflows/component.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 2bfd6a3c88dfe1277f2bfa221b30b025c594bbae 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 17/35] Drop support for PHP 7.3 (#1158) * Update compser.json files * Update GitHub Actions workflows * Update CHANGELOG.md * Update php.yml --- .github/workflows/component.yml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/component.yml b/.github/workflows/component.yml index be89048..93d7482 100644 --- a/.github/workflows/component.yml +++ b/.github/workflows/component.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 24803a0..0dd7e72 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "^7.3 || ^8.0", + "php": "^7.4 || ^8.0", "php-http/client-implementation": "^1.0", "php-http/discovery": "^1.6", "php-http/httplug": "^1.0 || ^2.0", From 9aa0106073c95c6b23023011bfb3e8c391c3e2eb Mon Sep 17 00:00:00 2001 From: Jasper Zonneveld Date: Sat, 30 Jul 2022 12:48:32 +0200 Subject: [PATCH 18/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 --- Provider/AbstractHttpProvider.php | 12 ++++++------ Tests/Provider/AbstractHttpProviderTest.php | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Provider/AbstractHttpProvider.php b/Provider/AbstractHttpProvider.php index 9dcec34..8a24fab 100644 --- a/Provider/AbstractHttpProvider.php +++ b/Provider/AbstractHttpProvider.php @@ -18,7 +18,7 @@ use Geocoder\Provider\AbstractProvider; use Http\Message\MessageFactory; use Http\Discovery\MessageFactoryDiscovery; -use Http\Client\HttpClient; +use Psr\Http\Client\ClientInterface; use Psr\Http\Message\RequestInterface; /** @@ -28,7 +28,7 @@ abstract class AbstractHttpProvider extends AbstractProvider { /** - * @var HttpClient + * @var ClientInterface */ private $client; @@ -38,10 +38,10 @@ abstract class AbstractHttpProvider extends AbstractProvider private $messageFactory; /** - * @param HttpClient $client + * @param ClientInterface $client * @param MessageFactory|null $factory */ - public function __construct(HttpClient $client, MessageFactory $factory = null) + public function __construct(ClientInterface $client, MessageFactory $factory = null) { $this->client = $client; $this->messageFactory = $factory ?: MessageFactoryDiscovery::find(); @@ -106,9 +106,9 @@ protected function getParsedResponse(RequestInterface $request): string /** * Returns the HTTP adapter. * - * @return HttpClient + * @return ClientInterface */ - protected function getHttpClient(): HttpClient + protected function getHttpClient(): ClientInterface { return $this->client; } diff --git a/Tests/Provider/AbstractHttpProviderTest.php b/Tests/Provider/AbstractHttpProviderTest.php index 8a52124..7227af6 100644 --- a/Tests/Provider/AbstractHttpProviderTest.php +++ b/Tests/Provider/AbstractHttpProviderTest.php @@ -17,7 +17,7 @@ use Geocoder\Model\AddressCollection; use Geocoder\Query\GeocodeQuery; use Geocoder\Query\ReverseQuery; -use Http\Client\HttpClient; +use Psr\Http\Client\ClientInterface; use Http\Mock\Client; use PHPUnit\Framework\TestCase; @@ -33,7 +33,7 @@ public function testHttpClientGetter() class DummyProvider extends AbstractHttpProvider { - public function getHttpClient(): HttpClient + public function getHttpClient(): ClientInterface { return parent::getHttpClient(); } From f26562a5504305d949cf6134670a78c086a532b3 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 19/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 | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1707b84..dc84bad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,21 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.5.0 + +### Added + +- Add support for PHP 8.1 +- Add GitHub Actions workflow + +### Removed + +- Drop support for PHP 7.3 + +### Changed + +- Migrate from PHP-HTTP to PSR-18 client + ## 4.4.0 ### Added From 7517c1ffca066bbec4a242a2cad871cff28b4446 Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 5 Jan 2023 15:02:12 +0100 Subject: [PATCH 20/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/component.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/component.yml b/.github/workflows/component.yml index 93d7482..af55ac9 100644 --- a/.github/workflows/component.yml +++ b/.github/workflows/component.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 e72d46d109c51dae54e53699dcc32651b71c58cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 19 Feb 2023 18:31:10 +0100 Subject: [PATCH 21/35] Update symfony/stopwatch requirement from ~2.5 to ~2.5 || ~5.0 in /src/Http (#1177) Update symfony/stopwatch requirement || ~5.0 in /src/Http Updates the requirements on [symfony/stopwatch](https://github.com/symfony/stopwatch) to permit the latest version. - [Release notes](https://github.com/symfony/stopwatch/releases) - [Changelog](https://github.com/symfony/stopwatch/blob/6.2/CHANGELOG.md) - [Commits](https://github.com/symfony/stopwatch/compare/v2.5.0...v5.4.19) --- updated-dependencies: - dependency-name: symfony/stopwatch dependency-type: direct:development ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0dd7e72..31614af 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "php-http/message": "^1.0", "php-http/mock-client": "^1.0", "phpunit/phpunit": "^9.5", - "symfony/stopwatch": "~2.5" + "symfony/stopwatch": "~2.5 || ~5.0" }, "extra": { "branch-alias": { From 80acaedd397d4bdc77264202cefa6ded796caee7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 May 2023 21:13:55 +0200 Subject: [PATCH 22/35] Update psr/http-message requirement from ^1.0 to ^1.0 || ^2.0 in /src/Http (#1183) Update psr/http-message requirement || ^2.0 in /src/Http Updates the requirements on [psr/http-message](https://github.com/php-fig/http-message) to permit the latest version. - [Release notes](https://github.com/php-fig/http-message/releases) - [Changelog](https://github.com/php-fig/http-message/blob/master/CHANGELOG.md) - [Commits](https://github.com/php-fig/http-message/compare/1.0...2.0) --- updated-dependencies: - dependency-name: psr/http-message dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 31614af..b72b94b 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "php-http/discovery": "^1.6", "php-http/httplug": "^1.0 || ^2.0", "php-http/message-factory": "^1.0.2", - "psr/http-message": "^1.0", + "psr/http-message": "^1.0 || ^2.0", "psr/http-message-implementation": "^1.0", "willdurand/geocoder": "^4.0" }, From c7cc088becc872a594772eba056368e6d1014174 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 23/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 --- Provider/AbstractHttpProvider.php | 24 +-------------------- Tests/Provider/AbstractHttpProviderTest.php | 2 +- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/Provider/AbstractHttpProvider.php b/Provider/AbstractHttpProvider.php index 8a24fab..03db6ce 100644 --- a/Provider/AbstractHttpProvider.php +++ b/Provider/AbstractHttpProvider.php @@ -16,8 +16,8 @@ use Geocoder\Exception\InvalidServerResponse; use Geocoder\Exception\QuotaExceeded; use Geocoder\Provider\AbstractProvider; -use Http\Message\MessageFactory; use Http\Discovery\MessageFactoryDiscovery; +use Http\Message\MessageFactory; use Psr\Http\Client\ClientInterface; use Psr\Http\Message\RequestInterface; @@ -37,10 +37,6 @@ abstract class AbstractHttpProvider extends AbstractProvider */ private $messageFactory; - /** - * @param ClientInterface $client - * @param MessageFactory|null $factory - */ public function __construct(ClientInterface $client, MessageFactory $factory = null) { $this->client = $client; @@ -50,10 +46,6 @@ public function __construct(ClientInterface $client, MessageFactory $factory = n /** * Get URL and return contents. If content is empty, an exception will be thrown. * - * @param string $url - * - * @return string - * * @throws InvalidServerResponse */ protected function getUrlContents(string $url): string @@ -63,11 +55,6 @@ protected function getUrlContents(string $url): string return $this->getParsedResponse($request); } - /** - * @param string $url - * - * @return RequestInterface - */ protected function getRequest(string $url): RequestInterface { return $this->getMessageFactory()->createRequest('GET', $url); @@ -76,10 +63,6 @@ protected function getRequest(string $url): RequestInterface /** * Send request and return contents. If content is empty, an exception will be thrown. * - * @param RequestInterface $request - * - * @return string - * * @throws InvalidServerResponse */ protected function getParsedResponse(RequestInterface $request): string @@ -105,17 +88,12 @@ protected function getParsedResponse(RequestInterface $request): string /** * Returns the HTTP adapter. - * - * @return ClientInterface */ protected function getHttpClient(): ClientInterface { return $this->client; } - /** - * @return MessageFactory - */ protected function getMessageFactory(): MessageFactory { return $this->messageFactory; diff --git a/Tests/Provider/AbstractHttpProviderTest.php b/Tests/Provider/AbstractHttpProviderTest.php index 7227af6..79b41be 100644 --- a/Tests/Provider/AbstractHttpProviderTest.php +++ b/Tests/Provider/AbstractHttpProviderTest.php @@ -17,9 +17,9 @@ use Geocoder\Model\AddressCollection; use Geocoder\Query\GeocodeQuery; use Geocoder\Query\ReverseQuery; -use Psr\Http\Client\ClientInterface; use Http\Mock\Client; use PHPUnit\Framework\TestCase; +use Psr\Http\Client\ClientInterface; class AbstractHttpProviderTest extends TestCase { From 7a5590b4903db9e7ab1feced0b3f40c1e0d8e06e 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 24/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/component.yml | 2 +- composer.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/component.yml b/.github/workflows/component.yml index af55ac9..c471a22 100644 --- a/.github/workflows/component.yml +++ b/.github/workflows/component.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 b72b94b..c8f86a8 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": "^7.4 || ^8.0", + "php": "^8.0", "php-http/client-implementation": "^1.0", "php-http/discovery": "^1.6", "php-http/httplug": "^1.0 || ^2.0", From 15629fd7bf771f525282ad1b60d2106bcf630ce9 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 25/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 --- Tests/Provider/AbstractHttpProviderTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/Provider/AbstractHttpProviderTest.php b/Tests/Provider/AbstractHttpProviderTest.php index 79b41be..03f1765 100644 --- a/Tests/Provider/AbstractHttpProviderTest.php +++ b/Tests/Provider/AbstractHttpProviderTest.php @@ -23,7 +23,7 @@ class AbstractHttpProviderTest extends TestCase { - public function testHttpClientGetter() + public function testHttpClientGetter(): void { $client = $this->getMockBuilder(Client::class)->disableOriginalConstructor()->getMock(); $provider = new DummyProvider($client); From bdb892a6eefb9c0355ddd2b5756e49385fec5f27 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 15 Dec 2023 17:28:59 +0100 Subject: [PATCH 26/35] Replace HTTPlug factories by PSR-17 (#1184) * Replace HTTPlug factories by PSR-17 * minor fix --------- Co-authored-by: Nyholm --- Provider/AbstractHttpProvider.php | 134 ++++++++++++++++++++++++++++-- composer.json | 16 ++-- 2 files changed, 137 insertions(+), 13 deletions(-) diff --git a/Provider/AbstractHttpProvider.php b/Provider/AbstractHttpProvider.php index 03db6ce..b0d29c4 100644 --- a/Provider/AbstractHttpProvider.php +++ b/Provider/AbstractHttpProvider.php @@ -16,10 +16,16 @@ use Geocoder\Exception\InvalidServerResponse; use Geocoder\Exception\QuotaExceeded; use Geocoder\Provider\AbstractProvider; -use Http\Discovery\MessageFactoryDiscovery; +use Http\Discovery\Psr17Factory; use Http\Message\MessageFactory; use Psr\Http\Client\ClientInterface; +use Psr\Http\Message\RequestFactoryInterface; use Psr\Http\Message\RequestInterface; +use Psr\Http\Message\ResponseFactoryInterface; +use Psr\Http\Message\ResponseInterface; +use Psr\Http\Message\StreamFactoryInterface; +use Psr\Http\Message\StreamInterface; +use Psr\Http\Message\UriInterface; /** * @author William Durand @@ -33,14 +39,17 @@ abstract class AbstractHttpProvider extends AbstractProvider private $client; /** - * @var MessageFactory + * @var RequestFactoryInterface&StreamFactoryInterface)|MessageFactory */ private $messageFactory; - public function __construct(ClientInterface $client, MessageFactory $factory = null) + /** + * @param Psr17Factory|MessageFactory|null $factory Passing a MessageFactory is @deprecated + */ + public function __construct(ClientInterface $client, MessageFactory|Psr17Factory $factory = null) { $this->client = $client; - $this->messageFactory = $factory ?: MessageFactoryDiscovery::find(); + $this->messageFactory = $factory ?? ($client instanceof RequestFactoryInterface && $client instanceof StreamFactoryInterface ? $client : new Psr17Factory()); } /** @@ -57,7 +66,35 @@ protected function getUrlContents(string $url): string protected function getRequest(string $url): RequestInterface { - return $this->getMessageFactory()->createRequest('GET', $url); + return $this->createRequest('GET', $url); + } + + /** + * @param array $headers + */ + protected function createRequest(string $method, string $uri, array $headers = [], string $body = null): RequestInterface + { + if ($this->messageFactory instanceof MessageFactory) { + return $this->messageFactory->createRequest($method, $uri, $headers, $body); + } + + $request = $this->messageFactory->createRequest($method, $uri); + + foreach ($headers as $name => $value) { + $request = $request->withAddedHeader($name, $value); + } + + if (null === $body) { + return $request; + } + + $stream = $this->messageFactory->createStream($body); + + if ($stream->isSeekable()) { + $stream->seek(0); + } + + return $request->withBody($stream); } /** @@ -94,8 +131,93 @@ protected function getHttpClient(): ClientInterface return $this->client; } + /** + * @deprecated Use createRequest instead + */ protected function getMessageFactory(): MessageFactory { - return $this->messageFactory; + if ($this->messageFactory instanceof MessageFactory) { + return $this->messageFactory; + } + + $factory = $this->messageFactory instanceof ResponseFactoryInterface ? $this->messageFactory : new Psr17Factory(); + + return new class($factory) implements MessageFactory { + public function __construct( + /** + * @param RequestFactoryInterface&ResponseFactoryInterface&StreamFactoryInterface $factory + */ + private RequestFactoryInterface|ResponseFactoryInterface|StreamFactoryInterface $factory, + ) { + } + + /** + * @param string $method + * @param string|UriInterface $uri + * @param array $headers + * @param resource|string|StreamInterface|null $body + * @param string $protocolVersion + */ + public function createRequest($method, $uri, array $headers = [], $body = null, $protocolVersion = '1.1'): RequestInterface + { + $request = $this->factory->createRequest($method, $uri); + + foreach ($headers as $name => $value) { + $request = $request->withAddedHeader($name, $value); + } + + if (null !== $body) { + $request = $request->withBody($this->createStream($body)); + } + + return $request->withProtocolVersion($protocolVersion); + } + + /** + * @param int $statusCode + * @param string|null $reasonPhrase + * @param array $headers + * @param resource|string|StreamInterface|null $body + * @param string $protocolVersion + */ + public function createResponse($statusCode = 200, $reasonPhrase = null, array $headers = [], $body = null, $protocolVersion = '1.1'): ResponseInterface + { + $response = $this->factory->createResponse($statusCode, $reasonPhrase); + + foreach ($headers as $name => $value) { + $response = $response->withAddedHeader($name, $value); + } + + if (null !== $body) { + $response = $response->withBody($this->createStream($body)); + } + + return $response->withProtocolVersion($protocolVersion); + } + + /** + * @param string|resource|StreamInterface|null $body + */ + private function createStream($body = ''): StreamInterface + { + if ($body instanceof StreamInterface) { + return $body; + } + + if (\is_string($body ?? '')) { + $stream = $this->factory->createStream($body ?? ''); + } elseif (\is_resource($body)) { + $stream = $this->factory->createStreamFromResource($body); + } else { + throw new \InvalidArgumentException(sprintf('"%s()" expects string, resource or StreamInterface, "%s" given.', __METHOD__, get_debug_type($body))); + } + + if ($stream->isSeekable()) { + $stream->seek(0); + } + + return $stream; + } + }; } } diff --git a/composer.json b/composer.json index c8f86a8..b3a7844 100644 --- a/composer.json +++ b/composer.json @@ -15,12 +15,9 @@ ], "require": { "php": "^8.0", - "php-http/client-implementation": "^1.0", - "php-http/discovery": "^1.6", - "php-http/httplug": "^1.0 || ^2.0", - "php-http/message-factory": "^1.0.2", - "psr/http-message": "^1.0 || ^2.0", - "psr/http-message-implementation": "^1.0", + "php-http/discovery": "^1.17", + "psr/http-client-implementation": "^1.0", + "psr/http-factory-implementation": "^1.0", "willdurand/geocoder": "^4.0" }, "require-dev": { @@ -48,5 +45,10 @@ "scripts": { "test": "vendor/bin/phpunit", "test-ci": "vendor/bin/phpunit --coverage-text --coverage-clover=build/coverage.xml" + }, + "config": { + "allow-plugins": { + "php-http/discovery": false + } } -} \ No newline at end of file +} From d8c22a66120daed35ba8017467bc1ebfec28a63e Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Thu, 28 Dec 2023 11:51:54 +0100 Subject: [PATCH 27/35] Prepare release 4.6.0 of php-common (#1210) --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dc84bad..d0fb505 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" between each release. +## 4.6.0 + +- Drop support for PHP 7 +- Make PSR-17 a first class citizen + ## 4.5.0 ### Added From b0221b62860f77c1bb7eaea565d411549bf758eb Mon Sep 17 00:00:00 2001 From: chris Date: Sat, 2 Mar 2024 11:52:31 +0100 Subject: [PATCH 28/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/component.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/component.yml b/.github/workflows/component.yml index c471a22..483e8c8 100644 --- a/.github/workflows/component.yml +++ b/.github/workflows/component.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 e5a742b0579eaeb736c737cc19e9b15e14640b8d 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 29/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 --- Provider/AbstractHttpProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Provider/AbstractHttpProvider.php b/Provider/AbstractHttpProvider.php index b0d29c4..91fcb5c 100644 --- a/Provider/AbstractHttpProvider.php +++ b/Provider/AbstractHttpProvider.php @@ -46,7 +46,7 @@ abstract class AbstractHttpProvider extends AbstractProvider /** * @param Psr17Factory|MessageFactory|null $factory Passing a MessageFactory is @deprecated */ - public function __construct(ClientInterface $client, MessageFactory|Psr17Factory $factory = null) + public function __construct(ClientInterface $client, MessageFactory|Psr17Factory|null $factory = null) { $this->client = $client; $this->messageFactory = $factory ?? ($client instanceof RequestFactoryInterface && $client instanceof StreamFactoryInterface ? $client : new Psr17Factory()); @@ -72,7 +72,7 @@ protected function getRequest(string $url): RequestInterface /** * @param array $headers */ - protected function createRequest(string $method, string $uri, array $headers = [], string $body = null): RequestInterface + protected function createRequest(string $method, string $uri, array $headers = [], ?string $body = null): RequestInterface { if ($this->messageFactory instanceof MessageFactory) { return $this->messageFactory->createRequest($method, $uri, $headers, $body); From c27be402d3854d8f60143aa2eff2752348709568 Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 4 Mar 2024 10:43:01 +0100 Subject: [PATCH 30/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/component.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/component.yml b/.github/workflows/component.yml index 483e8c8..1959046 100644 --- a/.github/workflows/component.yml +++ b/.github/workflows/component.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 990d22175e1ce691d7ca30fd54a803d66a07fba8 Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 14 Nov 2024 12:27:14 +0100 Subject: [PATCH 31/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/component.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/component.yml b/.github/workflows/component.yml index 1959046..92d63bf 100644 --- a/.github/workflows/component.yml +++ b/.github/workflows/component.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 396e8dbca87731cc7ebfb4223c74b96568b169ac Mon Sep 17 00:00:00 2001 From: Tobias Nyholm Date: Wed, 1 Jan 2025 16:52:42 +0100 Subject: [PATCH 32/35] Prepare release of 5.0.0 for willdurand/geocoder (#1209) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Prepare release of 5.0.0 for willdurand/geocoder * Be more restrictrive with PHP versions * minor * Update matrix * minor * minor * cs fixes * Run tests on PHP 8.4 --------- Co-authored-by: Jonathan Beliën <1150563+jbelien@users.noreply.github.com> Co-authored-by: Jonathan Beliën --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index b3a7844..982d383 100644 --- a/composer.json +++ b/composer.json @@ -18,7 +18,7 @@ "php-http/discovery": "^1.17", "psr/http-client-implementation": "^1.0", "psr/http-factory-implementation": "^1.0", - "willdurand/geocoder": "^4.0" + "willdurand/geocoder": "^4.0|^5.0" }, "require-dev": { "nyholm/psr7": "^1.0", From 4209be6c31946ed5a658f6240ab21faaf5413f61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Tue, 15 Apr 2025 14:38:11 +0200 Subject: [PATCH 33/35] [Http] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0fb505..286f1ab 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.7.0 + +- Add support for PHP Geocoder 5 + ## 4.6.0 - Drop support for PHP 7 From 36e81e3cc67d9d4bff9d87661daef73290ecf8b0 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 286f1ab..5523568 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,11 +4,18 @@ The change log describes what is "Added", "Removed", "Changed" or "Fixed" betwee ## 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 From 581d1fbfba8509e72a5e45d41e2cc9e6e8b2e876 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 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 982d383..604b963 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "nyholm/psr7": "^1.0", "php-http/message": "^1.0", "php-http/mock-client": "^1.0", - "phpunit/phpunit": "^9.5", + "phpunit/phpunit": "^9.6.11", "symfony/stopwatch": "~2.5 || ~5.0" }, "extra": {