Skip to content

Commit c96b00f

Browse files
authored
Merge pull request #8 from reactphp-parallel/add-multi-argument-support-to-run-stub
Add multi argument support to run stub
2 parents b1782e3 + e3b1077 commit c96b00f

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

stubs/functions.stub

+22-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,28 @@ namespace parallel;
55
use Closure;
66

77
/**
8-
* @param (Closure():T)|(Closure():void) $task
9-
* @param array<mixed> $argv
8+
* @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
9+
* @param array{}|array{A0}|array{A0,A1}|array{A0,A1,A2}|array{A0,A1,A2,A3}|array{A0,A1,A2,A3,A4} $argv
10+
*
11+
* @return (
12+
* $task is (Closure():T) ? Future<T> : (
13+
* $task is (Closure(A0):T) ? Future<T> : (
14+
* $task is (Closure(A0,A1):T) ? Future<T> : (
15+
* $task is (Closure(A0,A1,A2):T) ? Future<T> : (
16+
* $task is (Closure(A0,A1,A2,A3):T) ? Future<T> : (
17+
* $task is (Closure(A0,A1,A2,A3,A4):T) ? Future<T> : null
18+
* )
19+
* )
20+
* )
21+
* )
22+
* )
23+
* )
24+
*
1025
* @template T
11-
* @return ($task is (Closure():T) ? Future<T> : null)
26+
* @template A0 (any number of function arguments, see https://github.com/phpstan/phpstan/issues/8214)
27+
* @template A1
28+
* @template A2
29+
* @template A3
30+
* @template A4
1231
*/
1332
function run(Closure $task, array $argv = null): ?Future {}

0 commit comments

Comments
 (0)