Skip to content

Commit d30a3e1

Browse files
authored
Merge pull request #51 from clue-labs/template-arguments
Improve template types to support typed handler arguments
2 parents 88e2fc4 + e03d2f9 commit d30a3e1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/Queue.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,14 @@ public static function any($concurrency, array $jobs, $handler)
318318
* $q = new Queue(10, null, array($browser, 'get'));
319319
* ```
320320
*
321-
* @param int $concurrency concurrency soft limit
322-
* @param int|null $limit queue hard limit or NULL=unlimited
323-
* @param callable(mixed):PromiseInterface<T> $handler
321+
* @template A1 (any number of function arguments, see https://github.com/phpstan/phpstan/issues/8214)
322+
* @template A2
323+
* @template A3
324+
* @template A4
325+
* @template A5
326+
* @param int $concurrency concurrency soft limit
327+
* @param int|null $limit queue hard limit or NULL=unlimited
328+
* @param callable(A1,A2,A3,A4,A5):PromiseInterface<T> $handler
324329
* @throws \InvalidArgumentException
325330
*/
326331
public function __construct($concurrency, $limit, $handler)

0 commit comments

Comments
 (0)