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
79
79
You can optionally define a description, help message and the
80
80
:doc: `input options and arguments </console/input >`::
81
81
82
+ // ...
83
+ // the short description shown while running "php bin/console list"
84
+ protected static $defaultDescription = 'Creates a new user.';
85
+
82
86
// ...
83
87
protected function configure(): void
84
88
{
85
89
$this
86
- // the short description shown while running "php bin/console list"
87
- ->setDescription('Creates a new user.')
90
+ ->setDescription(self::$defaultDescription)
88
91
89
92
// the full command description shown when running the command with
90
93
// the "--help" option
91
94
->setHelp('This command allows you to create a user...')
92
95
;
93
96
}
94
97
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
+
95
104
The ``configure() `` method is called automatically at the end of the command
96
105
constructor. If your command defines its own constructor, set the properties
97
106
first and then call to the parent constructor, to make those properties
You can’t perform that action at this time.
0 commit comments