File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -79,19 +79,28 @@ Configuring the Command
7979You can optionally define a description, help message and the
8080:doc: `input options and arguments </console/input >`::
8181
82+ // ...
83+ // the short description shown while running "php bin/console list"
84+ protected static $defaultDescription = 'Creates a new user.';
85+
8286 // ...
8387 protected function configure(): void
8488 {
8589 $this
86- // the short description shown while running "php bin/console list"
87- ->setDescription('Creates a new user.')
90+ ->setDescription(self::$defaultDescription)
8891
8992 // the full command description shown when running the command with
9093 // the "--help" option
9194 ->setHelp('This command allows you to create a user...')
9295 ;
9396 }
9497
98+ .. versionadded :: 5.3
99+
100+ The ``$defaultDescription `` static property was introduced in Symfony 5.3.
101+ It allows to make the ``php bin/console list `` lazy.
102+ You can as well use ``php bin/console list --short `` option to have the output faster.
103+
95104The ``configure() `` method is called automatically at the end of the command
96105constructor. If your command defines its own constructor, set the properties
97106first and then call to the parent constructor, to make those properties
You can’t perform that action at this time.
0 commit comments