From f0bf5fcf12bb8d88382513a4673c53123a2322f4 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Tue, 24 Sep 2024 21:39:00 +0800 Subject: [PATCH] [8.x] Use Artisan Console View Components (#1132) Signed-off-by: Mior Muhammad Zaki --- src/Console/ChromeDriverCommand.php | 4 ++-- src/Console/InstallCommand.php | 22 +++++++++++----------- src/Console/PurgeCommand.php | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/Console/ChromeDriverCommand.php b/src/Console/ChromeDriverCommand.php index 054d69698..d63146e4a 100644 --- a/src/Console/ChromeDriverCommand.php +++ b/src/Console/ChromeDriverCommand.php @@ -103,7 +103,7 @@ public function handle() $message = 'ChromeDriver %s successfully installed for version %s.'; - $this->info(sprintf($message, $all ? 'binaries' : 'binary', $version)); + $this->components->info(sprintf($message, $all ? 'binaries' : 'binary', $version)); } /** @@ -176,7 +176,7 @@ protected function detectChromeVersion($os) return $matches[1]; } - $this->error('Chrome version could not be detected.'); + $this->components->error('Chrome version could not be detected.'); return false; } diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php index 94d548375..19110ec88 100644 --- a/src/Console/InstallCommand.php +++ b/src/Console/InstallCommand.php @@ -98,21 +98,21 @@ public function handle() )); } - $this->info('Dusk scaffolding installed successfully.'); + $this->components->info('Dusk scaffolding installed successfully.'); - $this->comment('Downloading ChromeDriver binaries...'); + $this->components->task('Downloading ChromeDriver binaries...', function () { + $driverCommandArgs = []; - $driverCommandArgs = []; - - if ($this->option('proxy')) { - $driverCommandArgs['--proxy'] = $this->option('proxy'); - } + if ($this->option('proxy')) { + $driverCommandArgs['--proxy'] = $this->option('proxy'); + } - if ($this->option('ssl-no-verify')) { - $driverCommandArgs['--ssl-no-verify'] = true; - } + if ($this->option('ssl-no-verify')) { + $driverCommandArgs['--ssl-no-verify'] = true; + } - $this->call('dusk:chrome-driver', $driverCommandArgs); + $this->call('dusk:chrome-driver', $driverCommandArgs); + }); } /** diff --git a/src/Console/PurgeCommand.php b/src/Console/PurgeCommand.php index 41d23bfe4..251002e7a 100644 --- a/src/Console/PurgeCommand.php +++ b/src/Console/PurgeCommand.php @@ -96,7 +96,7 @@ protected function purgeDebuggingFiles($relativePath, $patterns) $path = base_path($relativePath); if (! is_dir($path)) { - $this->warn( + $this->components->warn( "Unable to purge missing directory [{$relativePath}].", OutputInterface::VERBOSITY_DEBUG ); @@ -111,6 +111,6 @@ protected function purgeDebuggingFiles($relativePath, $patterns) @unlink($file->getRealPath()); } - $this->info("Purged \"{$patterns}\" from [{$relativePath}]."); + $this->components->info("Purged \"{$patterns}\" from [{$relativePath}]."); } }