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] 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;