Skip to content

Commit

Permalink
Place merged items in initial array
Browse files Browse the repository at this point in the history
  • Loading branch information
caendesilva committed Nov 12, 2023
1 parent e666159 commit b2a2729
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/realtime-compiler/src/ConsoleOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ public function printStartMessage(string $host, int $port): void
$url = sprintf('%s://%s:%d', $port === 443 ? 'https' : 'http', $host, $port);

$lines = [
'',
sprintf('<span class="text-blue-500">%s</span> <span class="text-gray">%s</span>', 'HydePHP Realtime Compiler', 'v'.Hyde::getInstance()->version()),
'',
sprintf('<span class="text-white">Listening on</span> <a href="%s" class="text-yellow-500">%s</a>', $url, $url),
'',
];

$lineLength = max(array_map('strlen', array_map('strip_tags', $lines)));
Expand All @@ -39,7 +41,7 @@ public function printStartMessage(string $host, int $port): void
return sprintf('&nbsp;│&nbsp;<span class="text-white">%s</span>%s│',
$line, str_repeat('&nbsp;', ($lineLength - strlen(strip_tags($line))) + 1)
);
}, array_merge([''], $lines, ['']));
}, $lines);

$topLine = sprintf('&nbsp;╭%s╮', str_repeat('', $lineLength + 2));
$bottomLine = sprintf('&nbsp;╰%s╯', str_repeat('', $lineLength + 2));
Expand Down

0 comments on commit b2a2729

Please sign in to comment.