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;