From 0f266971e4b3492a4a03d77fc80357fa92629efb Mon Sep 17 00:00:00 2001 From: Deeka Wong Date: Thu, 4 Jul 2024 10:13:45 +0800 Subject: [PATCH] Optimized phpdoc (#6927) --- src/Functions.php | 6 ++++++ src/Waiter.php | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/Functions.php b/src/Functions.php index aafaf8e..4746836 100644 --- a/src/Functions.php +++ b/src/Functions.php @@ -30,6 +30,12 @@ function parallel(array $callables, int $concurrent = 0): array return $parallel->wait(); } +/** + * @template TReturn + * + * @param Closure():TReturn $closure + * @return TReturn + */ function wait(Closure $closure, ?float $timeout = null) { if (ApplicationContext::hasContainer()) { diff --git a/src/Waiter.php b/src/Waiter.php index febb0ec..c0231d5 100644 --- a/src/Waiter.php +++ b/src/Waiter.php @@ -30,7 +30,11 @@ public function __construct(float $timeout = 10.0) } /** + * @template TReturn + * + * @param Closure():TReturn $closure * @param null|float $timeout seconds + * @return TReturn */ public function wait(Closure $closure, ?float $timeout = null) {