From 75afc9f58b4403be1de9df83f04012d7076c6192 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Tue, 19 Mar 2024 11:37:49 +1100 Subject: [PATCH 1/2] Make commands lazy --- src/Console/ChromeDriverCommand.php | 2 ++ src/Console/DuskCommand.php | 2 ++ src/Console/InstallCommand.php | 2 ++ src/Console/PurgeCommand.php | 2 ++ 4 files changed, 8 insertions(+) diff --git a/src/Console/ChromeDriverCommand.php b/src/Console/ChromeDriverCommand.php index 94439b6d1..45e642008 100644 --- a/src/Console/ChromeDriverCommand.php +++ b/src/Console/ChromeDriverCommand.php @@ -8,12 +8,14 @@ use Illuminate\Console\Command; use Illuminate\Support\Str; use Laravel\Dusk\OperatingSystem; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Process\Process; use ZipArchive; /** * @copyright Originally created by Jonas Staudenmeir: https://github.com/staudenmeir/dusk-updater */ +#[AsCommand(name: 'dusk:chrome-driver')] class ChromeDriverCommand extends Command { /** diff --git a/src/Console/DuskCommand.php b/src/Console/DuskCommand.php index dac8f01ee..cf329a266 100644 --- a/src/Console/DuskCommand.php +++ b/src/Console/DuskCommand.php @@ -7,11 +7,13 @@ use Illuminate\Support\Str; use NunoMaduro\Collision\Adapters\Phpunit\Subscribers\EnsurePrinterIsRegisteredSubscriber; use PHPUnit\Runner\Version; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Finder\Finder; use Symfony\Component\Process\Exception\ProcessSignaledException; use Symfony\Component\Process\Exception\RuntimeException; use Symfony\Component\Process\Process; +#[AsCommand(name: 'dusk')] class DuskCommand extends Command { use Concerns\InteractsWithTestingFrameworks; diff --git a/src/Console/InstallCommand.php b/src/Console/InstallCommand.php index a4ccdf8b8..94d548375 100644 --- a/src/Console/InstallCommand.php +++ b/src/Console/InstallCommand.php @@ -3,7 +3,9 @@ namespace Laravel\Dusk\Console; use Illuminate\Console\Command; +use Symfony\Component\Console\Attribute\AsCommand; +#[AsCommand(name: 'dusk:install')] class InstallCommand extends Command { use Concerns\InteractsWithTestingFrameworks; diff --git a/src/Console/PurgeCommand.php b/src/Console/PurgeCommand.php index 40b58284e..41d23bfe4 100644 --- a/src/Console/PurgeCommand.php +++ b/src/Console/PurgeCommand.php @@ -3,9 +3,11 @@ namespace Laravel\Dusk\Console; use Illuminate\Console\Command; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Finder\Finder; +#[AsCommand(name: 'dusk:purge')] class PurgeCommand extends Command { /** From c759f72dc795f98a21586fa9eba12d08333bc72a Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Tue, 19 Mar 2024 14:04:34 +1100 Subject: [PATCH 2/2] Make commands lazy --- src/Console/ComponentCommand.php | 2 ++ src/Console/MakeCommand.php | 2 ++ src/Console/PageCommand.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/Console/ComponentCommand.php b/src/Console/ComponentCommand.php index 49130d546..cf0d280af 100644 --- a/src/Console/ComponentCommand.php +++ b/src/Console/ComponentCommand.php @@ -4,7 +4,9 @@ use Illuminate\Console\GeneratorCommand; use Illuminate\Support\Str; +use Symfony\Component\Console\Attribute\AsCommand; +#[AsCommand(name: 'dusk:component')] class ComponentCommand extends GeneratorCommand { /** diff --git a/src/Console/MakeCommand.php b/src/Console/MakeCommand.php index fa2062c61..148cc8bd6 100644 --- a/src/Console/MakeCommand.php +++ b/src/Console/MakeCommand.php @@ -4,7 +4,9 @@ use Illuminate\Console\GeneratorCommand; use Illuminate\Support\Str; +use Symfony\Component\Console\Attribute\AsCommand; +#[AsCommand(name: 'dusk:make')] class MakeCommand extends GeneratorCommand { use Concerns\InteractsWithTestingFrameworks; diff --git a/src/Console/PageCommand.php b/src/Console/PageCommand.php index 94526220e..48892c883 100644 --- a/src/Console/PageCommand.php +++ b/src/Console/PageCommand.php @@ -4,7 +4,9 @@ use Illuminate\Console\GeneratorCommand; use Illuminate\Support\Str; +use Symfony\Component\Console\Attribute\AsCommand; +#[AsCommand(name: 'dusk:page')] class PageCommand extends GeneratorCommand { /**