From f424dacc5479cfdf40c24ac1e3705e259d7ec323 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Tue, 19 Mar 2024 13:27:33 +1100 Subject: [PATCH 1/2] Make commands lazy --- src/Console/Commands/InstallCommand.php | 2 ++ src/Servers/Reverb/Console/Commands/RestartServer.php | 2 ++ src/Servers/Reverb/Console/Commands/StartServer.php | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/Console/Commands/InstallCommand.php b/src/Console/Commands/InstallCommand.php index b37c1844..29e7c9d7 100644 --- a/src/Console/Commands/InstallCommand.php +++ b/src/Console/Commands/InstallCommand.php @@ -6,9 +6,11 @@ use Illuminate\Support\Arr; use Illuminate\Support\Facades\File; use Illuminate\Support\Str; +use Symfony\Component\Console\Attribute\AsCommand; use function Laravel\Prompts\confirm; +#[AsCommand(name: 'reverb:install')] class InstallCommand extends Command { /** diff --git a/src/Servers/Reverb/Console/Commands/RestartServer.php b/src/Servers/Reverb/Console/Commands/RestartServer.php index 2b0e37d4..9730859d 100644 --- a/src/Servers/Reverb/Console/Commands/RestartServer.php +++ b/src/Servers/Reverb/Console/Commands/RestartServer.php @@ -5,7 +5,9 @@ use Illuminate\Console\Command; use Illuminate\Support\Facades\Cache; use Illuminate\Support\InteractsWithTime; +use Symfony\Component\Console\Attribute\AsCommand; +#[AsCommand(name: 'reverb:restart')] class RestartServer extends Command { use InteractsWithTime; diff --git a/src/Servers/Reverb/Console/Commands/StartServer.php b/src/Servers/Reverb/Console/Commands/StartServer.php index 3ef1c44d..c0215988 100644 --- a/src/Servers/Reverb/Console/Commands/StartServer.php +++ b/src/Servers/Reverb/Console/Commands/StartServer.php @@ -17,8 +17,10 @@ use Laravel\Reverb\Servers\Reverb\Http\Server; use React\EventLoop\Loop; use React\EventLoop\LoopInterface; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\SignalableCommandInterface; +#[AsCommand(name: 'reverb:start')] class StartServer extends Command implements SignalableCommandInterface { /** From 45be7212294257ccc93c287c776a164538e81829 Mon Sep 17 00:00:00 2001 From: Tim MacDonald Date: Tue, 19 Mar 2024 13:27:42 +1100 Subject: [PATCH 2/2] Fix console command --- composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/composer.json b/composer.json index 540fb163..dfa86d36 100644 --- a/composer.json +++ b/composer.json @@ -31,6 +31,7 @@ "ratchet/rfc6455": "^0.3.1", "react/promise-timer": "^1.10", "react/socket": "^1.14", + "symfony/console": "^6.0|^7.0", "symfony/http-foundation": "^6.3|^7.0" }, "require-dev": {