Skip to content

Commit b1f0343

Browse files
committed
Incorporate feedback
1 parent 1754ff8 commit b1f0343

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

service_container/lazy_services.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Lazy Services
66

77
.. seealso::
88

9-
Another way to inject services lazily is via a :doc:`service subscriber </service_container/service_subscribers>`.
9+
Another way to inject services lazily is via a :doc:`service subscriber </service_container/service_subscribers_locators>`.
1010

1111
Why Lazy Services?
1212
------------------

service_container/service_subscribers.rst renamed to service_container/service_subscribers_locators.rst

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. index::
22
single: DependencyInjection; Service Subscribers
33

4-
Service Subscribers
5-
===================
4+
Service Subscribers & Locators
5+
==============================
66

77
Sometimes, a service needs access to several other services without being sure
88
that all of them will actually be used. In those cases, you may want the
@@ -85,7 +85,7 @@ Defining a Service Subscriber
8585
-----------------------------
8686

8787
First, turn ``CommandBus`` into an implementation of :class:`Symfony\\Component\\DependencyInjection\\ServiceSubscriberInterface`.
88-
Use its ``getSubscribedServices`` method to include as many services as needed
88+
Use its ``getSubscribedServices()`` method to include as many services as needed
8989
in the service subscriber and change the type hint of the container to
9090
a PSR-11 ``ContainerInterface``::
9191

@@ -141,7 +141,7 @@ which implements the PSR-11 ``ContainerInterface``, but it is also a callable::
141141

142142
return $handler->handle($command);
143143

144-
Including services
144+
Including Services
145145
------------------
146146

147147
In order to add a new dependency to the service subscriber, use the
@@ -158,7 +158,7 @@ service locator::
158158
];
159159
}
160160

161-
Service types can also be keyed by a service name for use internally::
161+
Service types can also be keyed by a service name for internal use::
162162

163163
use Psr\Log\LoggerInterface;
164164

@@ -170,7 +170,7 @@ Service types can also be keyed by a service name for use internally::
170170
];
171171
}
172172

173-
Optional services
173+
Optional Services
174174
~~~~~~~~~~~~~~~~~
175175

176176
For optional dependencies, prepend the service type with a ``?`` to prevent
@@ -191,7 +191,7 @@ errors if there's no matching service found in the service container::
191191
Make sure an optional service exists by calling ``has()`` on the service
192192
locator before calling the service itself.
193193

194-
Aliased services
194+
Aliased Services
195195
~~~~~~~~~~~~~~~~
196196

197197
By default, autowiring is used to match a service type to a service from the

0 commit comments

Comments
 (0)