From b2988cd1c0594dd6c9e6e6cc529796dbf6e880f3 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 9 Mar 2018 16:58:28 +0100 Subject: [PATCH 1/4] Fix the explanation about registering commands --- console.rst | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/console.rst b/console.rst index ee8c4a78be2..864efcc71ba 100644 --- a/console.rst +++ b/console.rst @@ -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 ` -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: + +#. Be stored in a directory called ``Command/``; +#. Be defined in a class whose name ends with ``Command``; +#. Be defined in a class that extends from + :class:`Symfony\\Component\\Console\\Command\\Command`. Executing the Command --------------------- From f2a07c37990b1f619f7e02cd859bb30f93907536 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 9 Mar 2018 17:00:10 +0100 Subject: [PATCH 2/4] Minor reword --- console.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/console.rst b/console.rst index 864efcc71ba..3fd8edf7520 100644 --- a/console.rst +++ b/console.rst @@ -65,11 +65,11 @@ Registering the Command ----------------------- Symfony commands must be registered before using them. In order to be registered, -a command must: +a command must bw: -#. Be stored in a directory called ``Command/``; -#. Be defined in a class whose name ends with ``Command``; -#. Be defined in a class that extends from +#. 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 From 84b99e9c421e77ecf620be6c9c2729834ff64ebb Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 9 Mar 2018 17:07:19 +0100 Subject: [PATCH 3/4] Typo --- console.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console.rst b/console.rst index 3fd8edf7520..8622e5ad411 100644 --- a/console.rst +++ b/console.rst @@ -65,7 +65,7 @@ Registering the Command ----------------------- Symfony commands must be registered before using them. In order to be registered, -a command must bw: +a command must be: #. Stored in a directory called ``Command/``; #. Defined in a class whose name ends with ``Command``; From c3a44fda2425e0ba87debb1d8a059defa7cdd0f5 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 10 Mar 2018 19:55:46 +0100 Subject: [PATCH 4/4] Reword --- console.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/console.rst b/console.rst index 8622e5ad411..5ce2cba2459 100644 --- a/console.rst +++ b/console.rst @@ -64,14 +64,17 @@ method. Then you can optionally define a help message and the Registering the Command ----------------------- -Symfony commands must be registered before using them. In order to be registered, -a command must be: +Symfony commands must be registered before using them. In order to be registered +automatically, a command must 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`. +If you can't meet these conditions for some command, the alternative is to +manually :doc`register the command as a service `. + Executing the Command ---------------------