File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -146,12 +146,8 @@ available in the ``configure()`` method::
146146Registering the Command
147147-----------------------
148148
149- Symfony commands must be registered as services and :doc: `tagged </service_container/tags >`
150- with the ``console.command `` tag. If you're using the
151- :ref: `default services.yaml configuration <service-container-services-load-example >`,
152- this is already done for you, thanks to :ref: `autoconfiguration <services-autoconfigure >`.
153-
154- On PHP 8, you can use native attribute ``AsCommand `` to configure::
149+ In PHP 8 and newer versions, you can register the command by adding the
150+ ``AsCommand `` attribute to it::
155151
156152 // src/Command/CreateUserCommand.php
157153 namespace App\Command;
@@ -175,6 +171,11 @@ On PHP 8, you can use native attribute ``AsCommand`` to configure::
175171 The ability to use PHP attributes to configure commands was introduced in
176172 Symfony 5.3.
177173
174+ If you can't use PHP attributes, register the command as a service and
175+ :doc: `tag it </service_container/tags >` with the ``console.command `` tag. If you're using the
176+ :ref: `default services.yaml configuration <service-container-services-load-example >`,
177+ this is already done for you, thanks to :ref: `autoconfiguration <services-autoconfigure >`.
178+
178179Executing the Command
179180---------------------
180181
You can’t perform that action at this time.
0 commit comments