From 4659a02026ecbe90bb3d7db16e5da614a1cf8c83 Mon Sep 17 00:00:00 2001 From: Graham Campbell Date: Mon, 30 Sep 2024 09:51:27 +0100 Subject: [PATCH 1/5] Test on PHP 8.3 and 8.4 --- .github/workflows/tests.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ea0f7b8..ab4c657 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] + php: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4'] steps: - name: Checkout code @@ -28,6 +28,10 @@ jobs: tools: composer:v2 coverage: none + - name: Emulate PHP 8.3 + run: composer config platform.php 8.3.999 + if: matrix.php == '8.4' + - name: Install PHP dependencies run: composer update --prefer-dist --no-interaction --no-progress From abc86c4f600ee7a5b527c00f2e2f4bf3446a6779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Hub=C3=ADk?= Date: Fri, 31 Oct 2025 14:49:44 +0100 Subject: [PATCH 2/5] PHP 8.4 compatibility for 1.2.* releases --- CHANGELOG.md | 5 +++++ src/FulfilledPromise.php | 2 +- src/Promise.php | 2 +- src/RejectedPromise.php | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a10d4e9..aff2be5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ # Change Log +## 1.2.2 + +### Added - 2025-10-31 + +- Compatibility with PHP 8.4 ## 1.2.1 diff --git a/src/FulfilledPromise.php b/src/FulfilledPromise.php index c9158e7..58465ae 100644 --- a/src/FulfilledPromise.php +++ b/src/FulfilledPromise.php @@ -29,7 +29,7 @@ public function __construct($result) /** * {@inheritdoc} */ - public function then(callable $onFulfilled = null, callable $onRejected = null) + public function then(?callable $onFulfilled = null, ?callable $onRejected = null) { if (null === $onFulfilled) { return $this; diff --git a/src/Promise.php b/src/Promise.php index 81434ae..642f32c 100644 --- a/src/Promise.php +++ b/src/Promise.php @@ -45,7 +45,7 @@ interface Promise * * @template V */ - public function then(callable $onFulfilled = null, callable $onRejected = null); + public function then(?callable $onFulfilled = null, ?callable $onRejected = null); /** * Returns the state of the promise, one of PENDING, FULFILLED or REJECTED. diff --git a/src/RejectedPromise.php b/src/RejectedPromise.php index a500048..51412be 100644 --- a/src/RejectedPromise.php +++ b/src/RejectedPromise.php @@ -26,7 +26,7 @@ public function __construct(\Exception $exception) /** * {@inheritdoc} */ - public function then(callable $onFulfilled = null, callable $onRejected = null) + public function then(?callable $onFulfilled = null, ?callable $onRejected = null) { if (null === $onRejected) { return $this; From 9aa9ea2c8b52e41b69d8e439c717c4caa295c8bd Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Sat, 8 Nov 2025 16:20:08 +0100 Subject: [PATCH 3/5] fix phpstan configuration --- phpstan-baseline.neon | 13 +++++++++++++ phpstan.neon.dist | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 phpstan-baseline.neon diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon new file mode 100644 index 0000000..cf32830 --- /dev/null +++ b/phpstan-baseline.neon @@ -0,0 +1,13 @@ +parameters: + ignoreErrors: + - + message: '#^Method Http\\Promise\\FulfilledPromise\:\:then\(\) should return Http\\Promise\\Promise\ but returns Http\\Promise\\RejectedPromise\\.$#' + identifier: return.type + count: 1 + path: src/FulfilledPromise.php + + - + message: '#^Method Http\\Promise\\RejectedPromise\:\:then\(\) should return Http\\Promise\\Promise\ but returns Http\\Promise\\RejectedPromise\\.$#' + identifier: return.type + count: 1 + path: src/RejectedPromise.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist index f8b94cf..66aff41 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,6 +1,7 @@ parameters: level: max - checkMissingIterableValueType: false treatPhpDocTypesAsCertain: false paths: - src +includes: + - phpstan-baseline.neon From b81bdf5a8e82a065fd73eb82919f28e0ac4d2a1b Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Sat, 8 Nov 2025 16:23:07 +0100 Subject: [PATCH 4/5] prepare release --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index aff2be5..2e2de54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ # Change Log + +# 1.2.x + ## 1.2.2 ### Added - 2025-10-31 From 5b4447a9d8d7916f9f87be8ff5e0dad006c7cdcb Mon Sep 17 00:00:00 2001 From: David Buchmann Date: Sat, 8 Nov 2025 16:39:59 +0100 Subject: [PATCH 5/5] remove baseline again for 1.3 as we removed the offending annotations --- phpstan-baseline.neon | 13 ------------- phpstan.neon.dist | 2 -- 2 files changed, 15 deletions(-) delete mode 100644 phpstan-baseline.neon diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon deleted file mode 100644 index cf32830..0000000 --- a/phpstan-baseline.neon +++ /dev/null @@ -1,13 +0,0 @@ -parameters: - ignoreErrors: - - - message: '#^Method Http\\Promise\\FulfilledPromise\:\:then\(\) should return Http\\Promise\\Promise\ but returns Http\\Promise\\RejectedPromise\\.$#' - identifier: return.type - count: 1 - path: src/FulfilledPromise.php - - - - message: '#^Method Http\\Promise\\RejectedPromise\:\:then\(\) should return Http\\Promise\\Promise\ but returns Http\\Promise\\RejectedPromise\\.$#' - identifier: return.type - count: 1 - path: src/RejectedPromise.php diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 66aff41..3e47faf 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -3,5 +3,3 @@ parameters: treatPhpDocTypesAsCertain: false paths: - src -includes: - - phpstan-baseline.neon