Skip to content

Commit 2ccf6a8

Browse files
committed
minor #18474 [Console] Deprecate $defaultName and $defaultDescription (alexandre-daubois)
This PR was merged into the 6.2 branch. Discussion ---------- [Console] Deprecate `$defaultName` and `$defaultDescription` <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `6.x` for features of unreleased versions). --> Commits ------- 61ec774 [Console] Deprecate `$defaultName` and `$defaultDescription`
2 parents 35ae166 + 61ec774 commit 2ccf6a8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

console.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,12 @@ You can optionally define a description, help message and the
171171
classes, but it won't show any description for commands that use the
172172
``setDescription()`` method instead of the static property.
173173

174+
.. deprecated:: 6.1
175+
176+
The static property ``$defaultDescription`` was deprecated in Symfony 6.1.
177+
Declare your command description with the ``#[AsCommand]`` attribute
178+
instead.
179+
174180
The ``configure()`` method is called automatically at the end of the command
175181
constructor. If your command defines its own constructor, set the properties
176182
first and then call to the parent constructor, to make those properties
@@ -234,6 +240,11 @@ If you can't use PHP attributes, register the command as a service and
234240
:ref:`default services.yaml configuration <service-container-services-load-example>`,
235241
this is already done for you, thanks to :ref:`autoconfiguration <services-autoconfigure>`.
236242

243+
.. deprecated:: 6.1
244+
245+
The static property ``$defaultName`` was deprecated in Symfony 6.1.
246+
Declare your command name with the ``#[AsCommand]`` attribute instead.
247+
237248
Running the Command
238249
~~~~~~~~~~~~~~~~~~~
239250

0 commit comments

Comments
 (0)