Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit fe06847

Browse files
authored
fix: missing newline on Windows (#9)
1 parent 6b5e12f commit fe06847

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/Server/Transport/Stdio/SymfonyConsoleTransport.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,12 @@ public function isConnected(): bool
3333

3434
public function receive(): \Generator
3535
{
36-
$stream = $this->input instanceof StreamableInputInterface ? $this->input->getStream() : STDIN;
37-
$line = fgets($stream ?? STDIN);
38-
36+
$stream = $this->input instanceof StreamableInputInterface ? $this->input->getStream() ?? STDIN : STDIN;
37+
$line = fgets($stream);
3938
if (false === $line) {
4039
return;
4140
}
42-
43-
$this->buffer .= $line;
41+
$this->buffer .= STDIN === $stream ? rtrim($line).PHP_EOL : $line;
4442
if (str_contains($this->buffer, PHP_EOL)) {
4543
$lines = explode(PHP_EOL, $this->buffer);
4644
$this->buffer = array_pop($lines);

0 commit comments

Comments
 (0)