Skip to content

SF 4+ does not rely on Command inheritance anymore #9403

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

Merged
merged 1 commit into from
Mar 7, 2018
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