Skip to content

Fix the explanation about registering commands #9419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions console.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,13 @@ method. Then you can optionally define a help message and the
Registering the Command
-----------------------

Symfony commands must be registered as services and :doc:`tagged </service_container/tags>`
with the ``console.command`` tag. If the PHP class of your command extends from
:class:`Symfony\\Component\\Console\\Command\\Command`, Symfony does this for
you automatically.
Symfony commands must be registered before using them. In order to be registered,
a command must bw:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

be


#. Stored in a directory called ``Command/``;
#. Defined in a class whose name ends with ``Command``;
#. Defined in a class that extends from
:class:`Symfony\\Component\\Console\\Command\\Command`.

Executing the Command
---------------------
Expand Down