From 9637621fa96b772a02d6b23f16d5c1511ab6d8fa Mon Sep 17 00:00:00 2001 From: Caen De Silva Date: Sat, 11 Nov 2023 10:58:46 +0100 Subject: [PATCH] Create property for console output --- .../framework/src/Console/Commands/ServeCommand.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/framework/src/Console/Commands/ServeCommand.php b/packages/framework/src/Console/Commands/ServeCommand.php index 04813e17308..e1dc710556c 100644 --- a/packages/framework/src/Console/Commands/ServeCommand.php +++ b/packages/framework/src/Console/Commands/ServeCommand.php @@ -27,8 +27,11 @@ class ServeCommand extends Command /** @var string */ protected $description = 'Start the realtime compiler server.'; + protected ConsoleOutput $console; + public function handle(): int { + $this->configureOutput(); $this->printStartMessage(); $this->runServerProcess(sprintf('php -S %s:%d %s', @@ -67,6 +70,13 @@ protected function getEnvironmentVariables(): array ]; } + protected function configureOutput(): void + { + if (! $this->useBasicOutput()) { + $this->console = new ConsoleOutput($this->output->isVerbose()); + } + } + protected function printStartMessage(): void { $this->useBasicOutput()