File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -267,20 +267,20 @@ The following example shows how to inject an anonymous service into another serv
267
267
$services = $configurator->services();
268
268
269
269
$services->set(Foo::class)
270
- ->args([service (AnonymousBar::class)])
270
+ ->args([inline_service (AnonymousBar::class)])
271
271
};
272
272
273
273
.. versionadded :: 5.1
274
274
275
- The ``service () `` function was introduced in Symfony 5.1. In previous
275
+ The ``inline_service () `` function was introduced in Symfony 5.1. In previous
276
276
versions it was called ``inline() ``.
277
277
278
278
.. note ::
279
279
280
280
Anonymous services do *NOT * inherit the definitions provided from the
281
281
defaults defined in the configuration. So you'll need to explicitly mark
282
282
service as autowired or autoconfigured when doing an anonymous service
283
- e.g.: ``service (Foo::class)->autowire()->autoconfigure() ``.
283
+ e.g.: ``inline_service (Foo::class)->autowire()->autoconfigure() ``.
284
284
285
285
Using an anonymous service as a factory looks like this:
286
286
@@ -323,7 +323,7 @@ Using an anonymous service as a factory looks like this:
323
323
$services = $configurator->services();
324
324
325
325
$services->set(Foo::class)
326
- ->factory([service (AnonymousBar::class), 'constructFoo'])
326
+ ->factory([inline_service (AnonymousBar::class), 'constructFoo'])
327
327
};
328
328
329
329
Deprecating Services
You can’t perform that action at this time.
0 commit comments