diff --git a/src/Internal/FulfilledPromise.php b/src/Internal/FulfilledPromise.php index e95d5aa4..651ec536 100644 --- a/src/Internal/FulfilledPromise.php +++ b/src/Internal/FulfilledPromise.php @@ -2,6 +2,7 @@ namespace React\Promise\Internal; +use JsonSerializable; use React\Promise\Promise; use React\Promise\PromiseInterface; use function React\Promise\enqueue; @@ -11,7 +12,7 @@ /** * @internal */ -final class FulfilledPromise implements PromiseInterface +final class FulfilledPromise implements PromiseInterface , JsonSerializable { private $value; @@ -77,4 +78,9 @@ public function always(callable $onFulfilledOrRejected): PromiseInterface public function cancel(): void { } + + public function jsonSerialize() + { + return $this->value; + } }