Skip to content

Commit 9bb6c70

Browse files
committed
added passthru() param-out
1 parent 827fcdf commit 9bb6c70

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

stubs/core.stub

+20-6
Original file line numberDiff line numberDiff line change
@@ -78,16 +78,30 @@ function parse_str(string $string, array &$result): void {}
7878
function similar_text(string $string1, string $string2, float &$percent = null) : int {}
7979

8080
/**
81-
* @param array<mixed> $output
82-
* @param int $result_code
83-
81+
* @param mixed $output
82+
* @param mixed $result_code
83+
*
8484
* @param-out list<string> $output
8585
* @param-out int $result_code
86+
*
87+
* @return string|false
88+
*/
89+
function exec(string $command, &$output, &$result_code) {}
90+
91+
/**
92+
* @param mixed $result_code
93+
* @param-out int $result_code
94+
*
95+
* @return string|false
96+
*/
97+
function system(string $command, &$result_code) {}
98+
99+
/**
100+
* @param mixed $result_code
101+
* @param-out int $result_code
86102
*/
87-
function exec(string $command, &$output, &$result_code): string|false {}
103+
function passthru(string $command, &$result_code): ?bool {}
88104

89-
/** @param-out int $result_code */
90-
function system(string $command, &$result_code): string|false {}
91105

92106
/**
93107
* @template T

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

+6
Original file line numberDiff line numberDiff line change
@@ -339,3 +339,9 @@ function fooSystem() {
339339

340340
assertType('int', $exitCode);
341341
}
342+
343+
function fooPassthru() {
344+
passthru("my cmd", $exitCode);
345+
346+
assertType('int', $exitCode);
347+
}

0 commit comments

Comments
 (0)