diff --git a/Classes/Command/CreateWizardCommand.php b/Classes/Command/CreateWizardCommand.php index e07e39a7..c6e73a37 100644 --- a/Classes/Command/CreateWizardCommand.php +++ b/Classes/Command/CreateWizardCommand.php @@ -17,6 +17,7 @@ namespace T3docs\Examples\Command; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; @@ -24,7 +25,10 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Style\SymfonyStyle; use T3docs\Examples\Exception\InvalidWizardException; +use TYPO3\CMS\Core\Attribute\AsNonSchedulableCommand; +#[AsCommand('examples:createwizard', 'A command that creates a wizard. It is hidden in the command list. You cannot use it in the scheduler.')] +#[AsNonSchedulableCommand] final class CreateWizardCommand extends Command { protected function configure(): void diff --git a/Classes/Command/DoSomethingCommand.php b/Classes/Command/DoSomethingCommand.php index ba238262..061c996d 100644 --- a/Classes/Command/DoSomethingCommand.php +++ b/Classes/Command/DoSomethingCommand.php @@ -17,10 +17,12 @@ namespace T3docs\Examples\Command; +use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; +#[AsCommand('examples:dosomething', 'A command that does nothing and always succeeds.')] final class DoSomethingCommand extends Command { protected function configure(): void diff --git a/Configuration/Services.yaml b/Configuration/Services.yaml index b535b3f3..f84a5961 100644 --- a/Configuration/Services.yaml +++ b/Configuration/Services.yaml @@ -12,20 +12,6 @@ services: tags: - name: linkvalidator.linktype - T3docs\Examples\Command\DoSomethingCommand: - tags: - - name: console.command - command: 'examples:dosomething' - description: 'A command that does nothing and always succeeds.' - - T3docs\Examples\Command\CreateWizardCommand: - tags: - - name: console.command - command: 'examples:createwizard' - description: 'A command that creates a wizard. It is hidden in the command list. You cannot use it in the scheduler.' - hidden: true - schedulable: false - T3docs\Examples\Controller\Haiku\DetailController: public: true