Skip to content

Commit

Permalink
Fix phpstan!
Browse files Browse the repository at this point in the history
  • Loading branch information
VennDev authored Aug 21, 2024
1 parent 1efc12c commit b292c15
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/vennv/vapm/Thread.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,10 +453,7 @@ public function start(array $mode = DescriptorSpec::BASIC): Promise
foreach ($read as $stream) {
if (!feof($stream)) {
$data = stream_get_contents($stream, 1024);
if ($data === false || $data === '') {
if (feof($stream)) continue 2;
break;
}
if ($data === false || $data === '') continue;
$stream === $pipes[1] ? $output .= $data : $error .= $data;
}
FiberManager::wait();
Expand All @@ -474,8 +471,8 @@ public function start(array $mode = DescriptorSpec::BASIC): Promise

$outputStream = stream_get_contents($pipes[1]);
$errorStream = stream_get_contents($pipes[2]);
$output .= str_contains($output, $outputStream) ? '' : $outputStream;
$error .= str_contains($error, $errorStream) ? '' : $errorStream;
if (!is_bool($outputStream)) $output .= str_contains($output, $outputStream) ? '' : $outputStream;
if (!is_bool($errorStream)) $error .= str_contains($error, $errorStream) ? '' : $errorStream;

fclose($pipes[1]);
fclose($pipes[2]);
Expand Down

0 comments on commit b292c15

Please sign in to comment.