From c25c32d22c830df44cdc271d1d74223f860c910b Mon Sep 17 00:00:00 2001 From: Derek Date: Sun, 20 Oct 2024 13:08:26 -0400 Subject: [PATCH] feat: Make commands lazy https://github.com/laravel/framework/pull/50617 No need to instantiate all 3 of these commands when running another command. --- src/Console/ChromeCommand.php | 2 ++ src/Console/FirefoxDriverCommand.php | 2 ++ src/Console/InstallCommand.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/Console/ChromeCommand.php b/src/Console/ChromeCommand.php index 711687e..ba2ea28 100644 --- a/src/Console/ChromeCommand.php +++ b/src/Console/ChromeCommand.php @@ -5,7 +5,9 @@ use Derekmd\Dusk\DuskFile; use Illuminate\Console\Command; use Illuminate\Support\Str; +use Symfony\Component\Console\Attribute\AsCommand; +#[AsCommand(name: 'dusk:chrome')] class ChromeCommand extends Command { /** diff --git a/src/Console/FirefoxDriverCommand.php b/src/Console/FirefoxDriverCommand.php index d750c63..99b2b3f 100644 --- a/src/Console/FirefoxDriverCommand.php +++ b/src/Console/FirefoxDriverCommand.php @@ -7,11 +7,13 @@ use Derekmd\Dusk\OperatingSystem; use Illuminate\Console\Command; use RuntimeException; +use Symfony\Component\Console\Attribute\AsCommand; /** * @copyright Proxy downloads are based on https://github.com/staudenmeir/dusk-updater * by Jonas Staudenmeir. */ +#[AsCommand(name: 'dusk:firefox-driver')] class FirefoxDriverCommand extends Command { use DownloadsBinaries; diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php index daa9844..3936ec6 100644 --- a/src/Console/InstallCommand.php +++ b/src/Console/InstallCommand.php @@ -3,7 +3,9 @@ namespace Derekmd\Dusk\Console; use Illuminate\Console\Command; +use Symfony\Component\Console\Attribute\AsCommand; +#[AsCommand(name: 'dusk:install-firefox')] class InstallCommand extends Command { /**