Skip to content

Commit 931e6f6

Browse files
committed
[#9223] Added some very very very minor fixes
* Made some minor PHP CS improvements; * Added a versionadded directive indicating this feature is new; * Added a redirect rule for the old file name
1 parent bcbbd15 commit 931e6f6

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

_build/redirection_map

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,4 +353,5 @@
353353
/templating/templating_service /templates
354354
/testing/simulating_authentication /testing/http_authentication
355355
/validation/group_service_resolver /form/validation_group_service_resolver
356-
/request/load_balancer_reverse_proxy /deployment/proxies
356+
/request/load_balancer_reverse_proxy /deployment/proxies
357+
/service_container/service_locators /service_container/service_subscribers_locators

service_container/service_subscribers_locators.rst

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
Service Subscribers & Locators
55
==============================
66

7+
.. versionadded:: 3.3
8+
Service subscribers and locators were introduced in Symfony 3.3.
9+
710
Sometimes, a service needs access to several other services without being sure
811
that all of them will actually be used. In those cases, you may want the
912
instantiation of the services to be lazy. However, that's not possible using
@@ -110,7 +113,7 @@ a PSR-11 ``ContainerInterface``::
110113
{
111114
return [
112115
'AppBundle\FooCommand' => FooHandler::class,
113-
'AppBundle\BarCommand' => BarHandler::class
116+
'AppBundle\BarCommand' => BarHandler::class,
114117
];
115118
}
116119

@@ -153,8 +156,8 @@ service locator::
153156
public static function getSubscribedServices()
154157
{
155158
return [
156-
//...
157-
LoggerInterface::class
159+
// ...
160+
LoggerInterface::class,
158161
];
159162
}
160163

@@ -165,8 +168,8 @@ Service types can also be keyed by a service name for internal use::
165168
public static function getSubscribedServices()
166169
{
167170
return [
168-
//...
169-
'logger' => LoggerInterface::class
171+
// ...
172+
'logger' => LoggerInterface::class,
170173
];
171174
}
172175

@@ -181,8 +184,8 @@ errors if there's no matching service found in the service container::
181184
public static function getSubscribedServices()
182185
{
183186
return [
184-
//...
185-
'?'.LoggerInterface::class
187+
// ...
188+
'?'.LoggerInterface::class,
186189
];
187190
}
188191

@@ -231,7 +234,7 @@ service type to a service.
231234
// app/config/services.php
232235
use AppBundle\CommandBus;
233236
234-
//...
237+
// ...
235238
236239
$container
237240
->register(CommandBus::class)
@@ -291,7 +294,7 @@ include as many services as needed in it.
291294
use Symfony\Component\DependencyInjection\ServiceLocator;
292295
use Symfony\Component\DependencyInjection\Reference;
293296
294-
//...
297+
// ...
295298
296299
$container
297300
->register('app.command_handler_locator', ServiceLocator::class)

0 commit comments

Comments
 (0)