From 60a88219c024f0772eac25b28180dd712533242d Mon Sep 17 00:00:00 2001 From: Brent Shaffer Date: Mon, 2 Dec 2024 07:58:17 -0800 Subject: [PATCH] add phpdoc templates to PromiseInterface --- src/PromiseInterface.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/PromiseInterface.php b/src/PromiseInterface.php index c11721e..d4b898c 100644 --- a/src/PromiseInterface.php +++ b/src/PromiseInterface.php @@ -12,6 +12,7 @@ * the reason why the promise cannot be fulfilled. * * @see https://promisesaplus.com/ + * @template T */ interface PromiseInterface { @@ -25,6 +26,7 @@ interface PromiseInterface * * @param callable $onFulfilled Invoked when the promise fulfills. * @param callable $onRejected Invoked when the promise is rejected. + * @return PromiseInterface */ public function then( ?callable $onFulfilled = null, @@ -82,7 +84,7 @@ public function cancel(): void; * * If the promise cannot be waited on, then the promise will be rejected. * - * @return mixed + * @return T|PromiseInterface * * @throws \LogicException if the promise has no wait function or if the * promise does not settle after waiting.