Skip to content

Commit 6ac823e

Browse files
committed
Add multi argument support to Runtime stub
1 parent b1782e3 commit 6ac823e

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

stubs/Runtime.stub

+22-3
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,29 @@ final class Runtime
3333
/* Execute */
3434

3535
/**
36-
* @param (Closure():T)|(Closure():void) $task
37-
* @param array<mixed> $argv
36+
* @param (Closure():T)|(Closure(A0):T)|(Closure(A0,A1):T)|(Closure(A0,A1,A2):T)|(Closure(A0,A1,A2,A3):T)|(Closure(A0,A1,A2,A3,A4):T)|(Closure():void)|(Closure(A0):void)|(Closure(A0,A1):void)|(Closure(A0,A1,A2):void)|(Closure(A0,A1,A2,A3):void)|(Closure(A0,A1,A2,A3,A4):void) $task
37+
* @param array{}|array{A0}|array{A0,A1}|array{A0,A1,A2}|array{A0,A1,A2,A3}|array{A0,A1,A2,A3,A4} $argv
38+
*
39+
* @return (
40+
* $task is (Closure():T) ? Future<T> : (
41+
* $task is (Closure(A0):T) ? Future<T> : (
42+
* $task is (Closure(A0,A1):T) ? Future<T> : (
43+
* $task is (Closure(A0,A1,A2):T) ? Future<T> : (
44+
* $task is (Closure(A0,A1,A2,A3):T) ? Future<T> : (
45+
* $task is (Closure(A0,A1,A2,A3,A4):T) ? Future<T> : null
46+
* )
47+
* )
48+
* )
49+
* )
50+
* )
51+
* )
52+
*
3853
* @template T
39-
* @return ($task is (Closure():T) ? Future<T> : null)
54+
* @template A0 (any number of function arguments, see https://github.com/phpstan/phpstan/issues/8214)
55+
* @template A1
56+
* @template A2
57+
* @template A3
58+
* @template A4
4059
*
4160
* @throws Runtime\Error\Closed if \parallel\Runtime was closed.
4261
* @throws Runtime\Error\IllegalFunction if task is a closure created from an internal function.

0 commit comments

Comments
 (0)