@@ -5,13 +5,15 @@ How to Make Commands Lazily Loaded
55 Support for command lazy loading was introduced in Symfony 3.4.
66
77.. note ::
8+
89 If you are using the Symfony full-stack framework, you are probably looking for
910 :ref: `lazy loading of commands defined as services <console-command-service-lazy-loading >`
1011
1112The traditional way of adding commands to your application is to use
1213:method: `Symfony\\ Component\\ Console\\ Application::add ` which expects a
1314``Command `` instance as argument.
14- In order to get commands loaded lazily, you need to register an intermediate router
15+
16+ In order to lazy load commands, you need to register an intermediate loader
1517which will be responsible for returning ``Command `` instances::
1618
1719 use AppBundle\Command\HeavyCommand;
@@ -34,7 +36,7 @@ This example makes use of the built-in
3436but the :method: `Symfony\\ Component\\ Console\\ Application::setCommandLoader `
3537method accepts any
3638:class: `Symfony\\ Component\\ Console\\ CommandLoader\\ CommandLoaderInterface `
37- instance so you can easily create and use your own implementation.
39+ instance so you can use your own implementation.
3840
3941Built-in Command Loaders
4042------------------------
@@ -61,9 +63,9 @@ is called.
6163~~~~~~~~~~~~~~~~~~~~~~~~~~
6264
6365The :class: `Symfony\\ Component\\ Console\\ CommandLoader\\ ContainerCommandLoader `
64- class can be used to load commands from a PSR-11 container.
65- As such, its constructor takes a PSR-11 ``ContainerInterface `` implementation as
66- first argument and a command map as last argument. The command map must be an array
66+ class can be used to load commands from a PSR-11 container. As such, its
67+ constructor takes a PSR-11 ``ContainerInterface `` implementation as first
68+ argument and a command map as last argument. The command map must be an array
6769with command names as keys and service identifiers as values::
6870
6971 use Symfony\Component\Console\CommandLoader\ContainerCommandLoader;
0 commit comments