We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b5e12f commit fe06847Copy full SHA for fe06847
src/Server/Transport/Stdio/SymfonyConsoleTransport.php
@@ -33,14 +33,12 @@ public function isConnected(): bool
33
34
public function receive(): \Generator
35
{
36
- $stream = $this->input instanceof StreamableInputInterface ? $this->input->getStream() : STDIN;
37
- $line = fgets($stream ?? STDIN);
38
-
+ $stream = $this->input instanceof StreamableInputInterface ? $this->input->getStream() ?? STDIN : STDIN;
+ $line = fgets($stream);
39
if (false === $line) {
40
return;
41
}
42
43
- $this->buffer .= $line;
+ $this->buffer .= STDIN === $stream ? rtrim($line).PHP_EOL : $line;
44
if (str_contains($this->buffer, PHP_EOL)) {
45
$lines = explode(PHP_EOL, $this->buffer);
46
$this->buffer = array_pop($lines);
0 commit comments