From e03d2f94c38da017603c146f7dbcb9cb4caba0a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Thu, 13 Mar 2025 12:01:15 +0100 Subject: [PATCH] Improve template types to support typed handler arguments --- src/Queue.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/Queue.php b/src/Queue.php index 2287514..7c7c624 100644 --- a/src/Queue.php +++ b/src/Queue.php @@ -318,9 +318,14 @@ public static function any($concurrency, array $jobs, $handler) * $q = new Queue(10, null, array($browser, 'get')); * ``` * - * @param int $concurrency concurrency soft limit - * @param int|null $limit queue hard limit or NULL=unlimited - * @param callable(mixed):PromiseInterface $handler + * @template A1 (any number of function arguments, see https://github.com/phpstan/phpstan/issues/8214) + * @template A2 + * @template A3 + * @template A4 + * @template A5 + * @param int $concurrency concurrency soft limit + * @param int|null $limit queue hard limit or NULL=unlimited + * @param callable(A1,A2,A3,A4,A5):PromiseInterface $handler * @throws \InvalidArgumentException */ public function __construct($concurrency, $limit, $handler)