Skip to content

Commit 790d672

Browse files
committed
minor #9971 Added a note about command aliases and services (javiereguiluz)
This PR was merged into the 3.4 branch. Discussion ---------- Added a note about command aliases and services Fixes #9421. Commits ------- f16b6da Added a note about command aliases and services
2 parents 4a88e71 + f16b6da commit 790d672

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

console/commands_as_services.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ Or set the ``command`` attribute on the ``console.command`` tag in your service
128128
->addTag('console.command', array('command' => 'app:sunshine'))
129129
;
130130
131+
.. note::
132+
133+
If the command defines aliases (using the
134+
:method:`Symfony\\Component\\Console\\Command\\Command::getAliases` method)
135+
you must add one ``console.command`` tag per alias.
136+
131137
That's it. One way or another, the ``SunshineCommand`` will be instantiated
132138
only when the ``app:sunshine`` command is actually called.
133139

0 commit comments

Comments
 (0)