Skip to content

Commit 3a54f71

Browse files
committed
Renamed service() as inline_service()
1 parent ec43b0c commit 3a54f71

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

service_container/alias_private.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,20 +267,20 @@ The following example shows how to inject an anonymous service into another serv
267267
$services = $configurator->services();
268268
269269
$services->set(Foo::class)
270-
->args([service(AnonymousBar::class)])
270+
->args([inline_service(AnonymousBar::class)])
271271
};
272272
273273
.. versionadded:: 5.1
274274

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
276276
versions it was called ``inline()``.
277277

278278
.. note::
279279

280280
Anonymous services do *NOT* inherit the definitions provided from the
281281
defaults defined in the configuration. So you'll need to explicitly mark
282282
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()``.
284284

285285
Using an anonymous service as a factory looks like this:
286286

@@ -323,7 +323,7 @@ Using an anonymous service as a factory looks like this:
323323
$services = $configurator->services();
324324
325325
$services->set(Foo::class)
326-
->factory([service(AnonymousBar::class), 'constructFoo'])
326+
->factory([inline_service(AnonymousBar::class), 'constructFoo'])
327327
};
328328
329329
Deprecating Services

0 commit comments

Comments
 (0)