Skip to content

Commit d0703db

Browse files
committed
minor #13544 [DI] Replaced inline() by service() in PHP DSL (javiereguiluz)
This PR was merged into the master branch. Discussion ---------- [DI] Replaced inline() by service() in PHP DSL Fixes #13526. Commits ------- a8b22a7 [DI] Replaced inline() by service() in PHP DSL
2 parents 5b6e28c + a8b22a7 commit d0703db

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

service_container/alias_private.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,15 +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([inline(AnonymousBar::class)])
270+
->args([service(AnonymousBar::class)])
271271
};
272272
273+
.. versionadded:: 5.1
274+
275+
The ``service()`` function was introduced in Symfony 5.1. In previous
276+
versions it was called ``inline()``.
277+
273278
.. note::
274279

275280
Anonymous services do *NOT* inherit the definitions provided from the
276281
defaults defined in the configuration. So you'll need to explicitly mark
277282
service as autowired or autoconfigured when doing an anonymous service
278-
e.g.: ``inline(Foo::class)->autowire()->autoconfigure()``.
283+
e.g.: ``service(Foo::class)->autowire()->autoconfigure()``.
279284

280285
Using an anonymous service as a factory looks like this:
281286

@@ -318,7 +323,7 @@ Using an anonymous service as a factory looks like this:
318323
$services = $configurator->services();
319324
320325
$services->set(Foo::class)
321-
->factory([inline(AnonymousBar::class), 'constructFoo'])
326+
->factory([service(AnonymousBar::class), 'constructFoo'])
322327
};
323328
324329
Deprecating Services

0 commit comments

Comments
 (0)