Skip to content

Commit c6ee285

Browse files
committed
added exec() param-out
1 parent 0e7176d commit c6ee285

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

stubs/core.stub

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,16 @@ function parse_str(string $string, array &$result): void {}
7777
/** @param-out float $percent */
7878
function similar_text(string $string1, string $string2, float &$percent = null) : int {}
7979

80+
/**
81+
* @param array<mixed> $output
82+
* @param int $result_code
83+
84+
* @param-out list<string> $output
85+
* @param-out int $result_code
86+
*/
87+
function exec(string $command, &$output, &$result_code): string|false {}
88+
89+
8090
/**
8191
* @template T
8292
* @template TArray as array<T>

tests/PHPStan/Analyser/data/param-out.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,3 +326,10 @@ function fooSimilar() {
326326
assertType('int', $similar);
327327
assertType('float', $percent);
328328
}
329+
330+
function fooExec() {
331+
exec("my cmd", $output, $exitCode);
332+
333+
assertType('list<string>', $output);
334+
assertType('int', $exitCode);
335+
}

0 commit comments

Comments
 (0)