Skip to content

Commit

Permalink
Remove unnecessary checks
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianfeldmann committed Nov 26, 2024
1 parent 54f00bd commit 6651081
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/Processor/ProcOpen.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ public function run(string $cmd, array $acceptableExitCodes = [0]): Result
$status = proc_get_status($process);
$stdOut .= stream_get_contents($pipes[1]);
$stdErr .= stream_get_contents($pipes[2]);
} while ($status && $status['running']);

$code = $status['exitcode'] ?? -1;
} while ($status['running']);

// make sure all pipes are closed before calling proc_close
foreach ($pipes as $index => $pipe) {
Expand All @@ -67,6 +65,6 @@ public function run(string $cmd, array $acceptableExitCodes = [0]): Result
proc_close($process);
error_reporting($old);

return new Result($cmd, $code, $stdOut, $stdErr, '', $acceptableExitCodes);
return new Result($cmd, $status['exitcode'], $stdOut, $stdErr, '', $acceptableExitCodes);
}
}

0 comments on commit 6651081

Please sign in to comment.