Skip to content

Commit 69aaed0

Browse files
committed
[FEATURE] Add attribute AsNonSchedulableCommand for "schedulable"
See https://review.typo3.org/c/Packages/TYPO3.CMS/+/91623 Releases: main
1 parent 7406ff0 commit 69aaed0

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

Classes/Command/CreateWizardCommand.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,18 @@
1717

1818
namespace T3docs\Examples\Command;
1919

20+
use Symfony\Component\Console\Attribute\AsCommand;
2021
use Symfony\Component\Console\Command\Command;
2122
use Symfony\Component\Console\Input\InputArgument;
2223
use Symfony\Component\Console\Input\InputInterface;
2324
use Symfony\Component\Console\Input\InputOption;
2425
use Symfony\Component\Console\Output\OutputInterface;
2526
use Symfony\Component\Console\Style\SymfonyStyle;
2627
use T3docs\Examples\Exception\InvalidWizardException;
28+
use TYPO3\CMS\Core\Attribute\AsNonSchedulableCommand;
2729

30+
#[AsCommand('examples:createwizard', 'A command that creates a wizard. It is hidden in the command list. You cannot use it in the scheduler.')]
31+
#[AsNonSchedulableCommand]
2832
final class CreateWizardCommand extends Command
2933
{
3034
protected function configure(): void

Classes/Command/DoSomethingCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@
1717

1818
namespace T3docs\Examples\Command;
1919

20+
use Symfony\Component\Console\Attribute\AsCommand;
2021
use Symfony\Component\Console\Command\Command;
2122
use Symfony\Component\Console\Input\InputInterface;
2223
use Symfony\Component\Console\Output\OutputInterface;
2324

25+
#[AsCommand('examples:dosomething', 'A command that does nothing and always succeeds.')]
2426
final class DoSomethingCommand extends Command
2527
{
2628
protected function configure(): void

Configuration/Services.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,6 @@ services:
1212
tags:
1313
- name: linkvalidator.linktype
1414

15-
T3docs\Examples\Command\DoSomethingCommand:
16-
tags:
17-
- name: console.command
18-
command: 'examples:dosomething'
19-
description: 'A command that does nothing and always succeeds.'
20-
21-
T3docs\Examples\Command\CreateWizardCommand:
22-
tags:
23-
- name: console.command
24-
command: 'examples:createwizard'
25-
description: 'A command that creates a wizard. It is hidden in the command list. You cannot use it in the scheduler.'
26-
hidden: true
27-
schedulable: false
28-
2915
T3docs\Examples\Controller\Haiku\DetailController:
3016
public: true
3117

0 commit comments

Comments
 (0)