From 987d97ad520396ffc4009bd9faff320210e1b0e6 Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Tue, 12 Nov 2024 20:09:03 +0200 Subject: [PATCH 1/2] Add AsCommand attributes to console commands --- src/Symfony/Command/ToggleGetCommand.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Symfony/Command/ToggleGetCommand.php b/src/Symfony/Command/ToggleGetCommand.php index fdca1b9..8ad7084 100644 --- a/src/Symfony/Command/ToggleGetCommand.php +++ b/src/Symfony/Command/ToggleGetCommand.php @@ -18,6 +18,7 @@ use SolidWorx\Toggler\ToggleInterface; use function sprintf; use function strpos; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Input\InputArgument; @@ -25,6 +26,7 @@ use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand(name: 'toggler:get', description: 'Get the status of a specific feature')] class ToggleGetCommand extends Command { protected static $defaultName = 'toggler:get'; From b871976c2277c449149f015d31031d2df14e17ff Mon Sep 17 00:00:00 2001 From: Pierre du Plessis Date: Tue, 12 Nov 2024 20:13:04 +0200 Subject: [PATCH 2/2] Add AsCommand attribute to all commands --- src/Symfony/Command/ToggleListCommand.php | 2 ++ src/Symfony/Command/ToggleSetCommand.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/Symfony/Command/ToggleListCommand.php b/src/Symfony/Command/ToggleListCommand.php index 2cb7b29..e9c48c0 100644 --- a/src/Symfony/Command/ToggleListCommand.php +++ b/src/Symfony/Command/ToggleListCommand.php @@ -19,12 +19,14 @@ use Symfony\Component\Console\Input\InputOption; use function explode; use function sprintf; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Helper\Table; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; use function strpos; +#[AsCommand(name: 'toggler:list', description: 'List all the configured features')] class ToggleListCommand extends Command { protected static $defaultName = 'toggler:list'; diff --git a/src/Symfony/Command/ToggleSetCommand.php b/src/Symfony/Command/ToggleSetCommand.php index 6fabeda..7e47f43 100644 --- a/src/Symfony/Command/ToggleSetCommand.php +++ b/src/Symfony/Command/ToggleSetCommand.php @@ -19,11 +19,13 @@ use SolidWorx\Toggler\Storage\StorageInterface; use SolidWorx\Toggler\Util; use function sprintf; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand(name: 'toggler:set', description: 'Change the status of a specific feature')] class ToggleSetCommand extends Command { protected static $defaultName = 'toggler:set';