Skip to content

Commit 936e773

Browse files
Use #[AsCommand] to describe commands
1 parent b198693 commit 936e773

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

Command/ServerDumpCommand.php

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

1212
namespace Symfony\Component\VarDumper\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\InputInterface;
@@ -32,11 +33,9 @@
3233
*
3334
* @final
3435
*/
36+
#[AsCommand(name: 'server:dump', description: 'Start a dump server that collects and displays dumps in a single place')]
3537
class ServerDumpCommand extends Command
3638
{
37-
protected static $defaultName = 'server:dump';
38-
protected static $defaultDescription = 'Start a dump server that collects and displays dumps in a single place';
39-
4039
private DumpServer $server;
4140

4241
/** @var DumpDescriptorInterface[] */
@@ -59,7 +58,6 @@ protected function configure()
5958

6059
$this
6160
->addOption('format', null, InputOption::VALUE_REQUIRED, sprintf('The output format (%s)', $availableFormats), 'cli')
62-
->setDescription(self::$defaultDescription)
6361
->setHelp(<<<'EOF'
6462
<info>%command.name%</info> starts a dump server that collects and displays
6563
dumps in a single place for debugging you application:

0 commit comments

Comments
 (0)