Skip to content

Commit d829257

Browse files
Use #[AsCommand] to describe commands
1 parent 10ee312 commit d829257

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Command/DebugCommand.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Symfony\Component\Form\Command;
1313

14+
use Symfony\Component\Console\Attribute\AsCommand;
1415
use Symfony\Component\Console\Command\Command;
1516
use Symfony\Component\Console\Exception\InvalidArgumentException;
1617
use Symfony\Component\Console\Input\InputArgument;
@@ -29,11 +30,9 @@
2930
*
3031
* @author Yonel Ceruto <[email protected]>
3132
*/
33+
#[AsCommand(name: 'debug:form', description: 'Display form type information')]
3234
class DebugCommand extends Command
3335
{
34-
protected static $defaultName = 'debug:form';
35-
protected static $defaultDescription = 'Display form type information';
36-
3736
private FormRegistryInterface $formRegistry;
3837
private array $namespaces;
3938
private array $types;
@@ -65,7 +64,6 @@ protected function configure()
6564
new InputOption('show-deprecated', null, InputOption::VALUE_NONE, 'Display deprecated options in form types'),
6665
new InputOption('format', null, InputOption::VALUE_REQUIRED, 'The output format (txt or json)', 'txt'),
6766
])
68-
->setDescription(self::$defaultDescription)
6967
->setHelp(<<<'EOF'
7068
The <info>%command.name%</info> command displays information about form types.
7169

0 commit comments

Comments
 (0)