Skip to content

Commit 81738f0

Browse files
Minor rewords
1 parent e2e0b44 commit 81738f0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

service_container/service_subscribers_locators.rst

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@ instantiation of the services to be lazy. However, that's not possible using
1313
the explicit dependency injection since services are not all meant to
1414
be ``lazy`` (see :doc:`/service_container/lazy_services`).
1515

16-
This can typically be the case in your controllers, where only one action is
17-
usually called per request, and where services are used conditionnally in each
18-
of them.
19-
16+
This can typically be the case in your controllers, where you may inject several
17+
services in the constructor, but the action executed only uses some of them.
2018
Another example are applications that implement the `Command pattern`_
2119
using a CommandBus to map command handlers by Command class names and use them
2220
to handle their respective command when it is asked for::
@@ -59,7 +57,7 @@ handlers could be to inject the main dependency injection container.
5957
However, injecting the entire container is discouraged because it gives too
6058
broad access to existing services and it hides the actual dependencies of the
6159
services. Doing so also requires services to be made public, which isn't the
62-
case by default since Symfony version 4.0.
60+
case by default in Symfony applications.
6361

6462
**Service Subscribers** are intended to solve this problem by giving access to a
6563
set of predefined services while instantiating them only when actually needed

0 commit comments

Comments
 (0)