From 69317c4ec0a3a137768bc9b365e2ecccdb9269b4 Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 10 Nov 2025 16:09:39 +0100 Subject: [PATCH 1/6] ci: add tests for PHP 8.5 bump checkout action 4 => 5 --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a385b83..3c7e6f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: strategy: max-parallel: 10 matrix: - php: [ '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] + php: [ '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.4'] steps: - name: Set up PHP @@ -25,7 +25,7 @@ jobs: tools: flex - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Download dependencies run: composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable @@ -48,7 +48,7 @@ jobs: tools: flex - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Download dependencies run: composer update --no-interaction --prefer-dist --optimize-autoloader --prefer-stable --prefer-lowest From de2784cd594c13ed8038762265f0e91112fb2cdc Mon Sep 17 00:00:00 2001 From: chris Date: Mon, 10 Nov 2025 16:10:31 +0100 Subject: [PATCH 2/6] Update PHP version matrix to include 8.5 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c7e6f4..50daf02 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: strategy: max-parallel: 10 matrix: - php: [ '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.4'] + php: [ '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] steps: - name: Set up PHP From e0447913c17f5271f8e9eb3ff5c5297aa54e096e Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Tue, 11 Nov 2025 11:21:10 +0100 Subject: [PATCH 3/6] ci: add tests for PHP 8.5 --- .github/workflows/ci.yml | 1 + composer.json | 2 +- tests/PromiseExceptionTest.php | 7 ++++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50daf02..41651d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: max-parallel: 10 + fail-fast: false matrix: php: [ '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] diff --git a/composer.json b/composer.json index d0a8ace..027616f 100644 --- a/composer.json +++ b/composer.json @@ -17,7 +17,7 @@ "guzzlehttp/guzzle": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^8.0|^9.3", + "phpunit/phpunit": "^8.5 || ^9.0 || ^10.0 || ^11.0 || ^12.0", "php-http/client-integration-tests": "^3.0", "phpspec/prophecy-phpunit": "^2.0", "php-http/message-factory": "^1.1" diff --git a/tests/PromiseExceptionTest.php b/tests/PromiseExceptionTest.php index b0d0276..9294e14 100644 --- a/tests/PromiseExceptionTest.php +++ b/tests/PromiseExceptionTest.php @@ -24,6 +24,7 @@ final class PromiseExceptionTest extends TestCase /** * @dataProvider exceptionThatIsThrownForGuzzleExceptionProvider */ + ##[DataProvider('exceptionThatIsThrownForGuzzleExceptionProvider')] public function testExceptionThatIsThrownForGuzzleException( RequestInterface $request, $reason, @@ -36,10 +37,10 @@ public function testExceptionThatIsThrownForGuzzleException( $promise->wait(); } - public function exceptionThatIsThrownForGuzzleExceptionProvider(): array + public static function exceptionThatIsThrownForGuzzleExceptionProvider(): array { - $request = $this->getMockBuilder(RequestInterface::class)->getMock(); - $response = $this->getMockBuilder(ResponseInterface::class)->getMock(); + $request = (new PromiseExceptionTest)->getMockBuilder(RequestInterface::class)->getMock(); + $response = (new PromiseExceptionTest)->getMockBuilder(ResponseInterface::class)->getMock(); return [ [$request, new GuzzleExceptions\ConnectException('foo', $request), NetworkException::class], From c58b8c6d5572f25c32c0db51f724a216f6f313f4 Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Tue, 11 Nov 2025 11:22:38 +0100 Subject: [PATCH 4/6] ci: add tests for PHP 8.5 --- tests/PromiseExceptionTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/PromiseExceptionTest.php b/tests/PromiseExceptionTest.php index 9294e14..f035753 100644 --- a/tests/PromiseExceptionTest.php +++ b/tests/PromiseExceptionTest.php @@ -28,7 +28,7 @@ final class PromiseExceptionTest extends TestCase public function testExceptionThatIsThrownForGuzzleException( RequestInterface $request, $reason, - string $adapterExceptionClass, + string $adapterExceptionClass ): void { $guzzlePromise = new \GuzzleHttp\Promise\Promise(); $guzzlePromise->reject($reason); From f1e2a746f60ff18b62e9582de0c9e5948d95eb65 Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Tue, 11 Nov 2025 11:28:56 +0100 Subject: [PATCH 5/6] ci: add tests for PHP 8.5 --- src/Client.php | 2 ++ src/Promise.php | 3 +++ 2 files changed, 5 insertions(+) diff --git a/src/Client.php b/src/Client.php index 51724a6..32ba777 100644 --- a/src/Client.php +++ b/src/Client.php @@ -43,11 +43,13 @@ public static function createWithConfig(array $config): Client return new self(self::buildClient($config)); } + #[\Override] public function sendRequest(RequestInterface $request): ResponseInterface { return $this->sendAsyncRequest($request)->wait(); } + #[\Override] public function sendAsyncRequest(RequestInterface $request) { $promise = $this->guzzle->sendAsync($request); diff --git a/src/Promise.php b/src/Promise.php index 815329d..14a8812 100644 --- a/src/Promise.php +++ b/src/Promise.php @@ -70,16 +70,19 @@ public function __construct(PromiseInterface $promise, RequestInterface $request }); } + #[\Override] public function then(?callable $onFulfilled = null, ?callable $onRejected = null) { return new static($this->promise->then($onFulfilled, $onRejected), $this->request); } + #[\Override] public function getState() { return $this->state; } + #[\Override] public function wait($unwrap = true) { $this->promise->wait(false); From 2cc1ccb0badc349120a75801e7890a15b566ad5d Mon Sep 17 00:00:00 2001 From: Christopher Georg Date: Tue, 11 Nov 2025 11:29:34 +0100 Subject: [PATCH 6/6] ci: add tests for PHP 8.5 --- .github/workflows/static.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml index 8de2f7d..866aeaa 100644 --- a/.github/workflows/static.yml +++ b/.github/workflows/static.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: PHPStan uses: docker://oskarstark/phpstan-ga @@ -26,7 +26,7 @@ jobs: name: PHP-CS-Fixer runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - name: PHP-CS-Fixer uses: docker://oskarstark/php-cs-fixer-ga with: @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Psalm uses: docker://vimeo/psalm-github-actions