Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze authored and github-actions[bot] committed Jan 31, 2025
1 parent e1ca936 commit 318fed0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/Process/ParallelProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ public function getOutput()
if (! $this->output) {
$processOutput = $this->process->getOutput();

$childResult = @unserialize(base64_decode($processOutput));
$childResult = @unserialize(base64_decode($processOutput));

if ($childResult === false || ! array_key_exists('output', $childResult)) {
$this->errorOutput = $processOutput;

return null;
return null;
}

$this->output = $childResult['output'];
$this->output = $childResult['output'];
}

return $this->output;
Expand All @@ -87,13 +87,13 @@ public function getErrorOutput()
if (! $this->errorOutput) {
$processOutput = $this->process->getErrorOutput();

$childResult = @unserialize(base64_decode($processOutput));
$childResult = @unserialize(base64_decode($processOutput));

if ($childResult === false || ! array_key_exists('output', $childResult)) {
$this->errorOutput = $processOutput;
} else {
$this->errorOutput = $childResult['output'];
}
} else {
$this->errorOutput = $childResult['output'];
}
}

return $this->errorOutput;
Expand Down
2 changes: 1 addition & 1 deletion src/Runtime/ChildRuntime.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

// php://stdout does not obey output buffering. Any output would break
// unserialization of child process results in the parent process.
if (!defined('STDOUT')) {
if (! defined('STDOUT')) {
define('STDOUT', fopen('php://temp', 'w+b'));
define('STDERR', fopen('php://stderr', 'wb'));
}
Expand Down
1 change: 1 addition & 0 deletions tests/ChildRuntimeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public function it_can_run()

$serializedClosure = base64_encode(serialize(new SerializableClosure(function () {
echo 'interfere with output';

return 'child';
})));

Expand Down

0 comments on commit 318fed0

Please sign in to comment.