Skip to content

Commit 3468082

Browse files
committed
Bugfix for trailing line in docker output
1 parent e2c6167 commit 3468082

4 files changed

Lines changed: 5 additions & 10 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,6 @@ $json·=·<<<"JSON"
287287
---→··"ascending":·false,
288288
---→··"users":·{$jsonUsers}
289289
---→}
290-
---→
291290
---→JSON;
292291

293292
echo·<<<JS

src/Formatter/DockerPipeFormatter.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ class DockerPipeFormatter extends AbstractCodecFormatter
6464
* @param 'never'|'missing'|'always' $pullMode
6565
*/
6666
public function __construct(
67-
string $image,
68-
array $options = [],
69-
array $command = [],
70-
string $pullMode = 'never',
67+
string $image,
68+
array $options = [],
69+
array $command = [],
70+
string $pullMode = 'never',
7171
?CodecInterface $interpolationCodec = null
7272
) {
7373
$this->image = $image;
@@ -165,8 +165,6 @@ protected function formatContent(string $original): string
165165
null
166166
);
167167

168-
return $process
169-
->mustRun()
170-
->getOutput();
168+
return substr($process->mustRun()->getOutput(), 0, -1);
171169
}
172170
}

tests/Unit/Formatter/DockerPipeFormatterTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public function testFormat(): void
4343
"mars"
4444
]
4545
}
46-
4746
JSON,
4847
implode('', $outputBlockString->segments)
4948
);

tests/fixtures/example-output.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
"ascending": false,
2222
"users": {$jsonUsers}
2323
}
24-
2524
JSON;
2625

2726
echo <<<JS

0 commit comments

Comments
 (0)