Skip to content

Commit 843d5a2

Browse files
committed
PR review changes
1 parent 4ea9996 commit 843d5a2

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/CLI/Console.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ static public function execute(string $cmd, string $stdin, string &$stdout, stri
144144
$start = \time();
145145
$stdout = '';
146146
$stderr = '';
147-
$statusPipe = '';
147+
$status = '';
148148

149149
if (\is_resource($process)) {
150150
\stream_set_blocking($pipes[0], false);
@@ -159,21 +159,19 @@ static public function execute(string $cmd, string $stdin, string &$stdout, stri
159159
while (\is_resource($process)) {
160160
$stdout .= \stream_get_contents($pipes[1]);
161161
$stderr .= \stream_get_contents($pipes[2]);
162-
$statusPipe .= \stream_get_contents($pipes[3]);
162+
$status .= \stream_get_contents($pipes[3]);
163163

164164
if ($timeout > 0 && \time() - $start > $timeout) {
165165
\proc_terminate($process, 9);
166166
return 1;
167167
}
168168

169-
$status = \proc_get_status($process);
170-
171-
if (!$status['running']) {
169+
if (!\proc_get_status($process)['running']) {
172170
\fclose($pipes[1]);
173171
\fclose($pipes[2]);
174172
\proc_close($process);
175173

176-
$exitCode = (int) str_replace("\n","",$statusPipe);
174+
$exitCode = (int) str_replace("\n","",$status);
177175

178176
return $exitCode;
179177
}

0 commit comments

Comments
 (0)