Skip to content
Merged
Changes from all 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
10 changes: 5 additions & 5 deletions console.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,20 @@ method. Then you can optionally define a help message and the
Executing the Command
---------------------

Symfony registers any PHP class extending :class:`Symfony\\Component\\Console\\Command\\Command`
as a console command automatically. So you can now execute this command in the
terminal:
You can now execute this command in the terminal:

.. code-block:: terminal

$ php bin/console app:create-user

.. note::

The command class must be registered as a service with the ``console.command`` tag.

If you're using the :ref:`default services.yaml configuration <service-container-services-load-example>`,
your command classes are automatically registered as services.
this is already done for you, thanks to :ref:`autoconfiguration <services-autoconfigure>`.

You can also manually register your command as a service by configuring the service
Otherwise, you can manually register your command as a service by configuring the service
and :doc:`tagging it </service_container/tags>` with ``console.command``.

As you might expect, this command will do nothing as you didn't write any logic
Expand Down