Skip to content

Commit

Permalink
Extract helper
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Nov 11, 2023
1 parent bd7740e commit 4267220
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/realtime-compiler/src/ConsoleOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,17 @@ public static function printMessage(string $message, string $context): void
protected function handleOutput(string $buffer): void
{
str($buffer)->trim()->explode("\n")->each(function (string $line): void {
$line = $this->formatLineForOutput($line);

if ($line !== null) {
render($line);
}
$this->renderLine($this->formatLineForOutput($line));
});
}

protected function renderLine(?string $line): void
{
if ($line !== null) {
render($line);
}
}

protected function formatLineForOutput(string $line): ?string
{
if (str_contains($line, 'Development Server (http:')) {
Expand Down

0 comments on commit 4267220

Please sign in to comment.