From 1fd4f07e8762939419e9dc07e69475796aa73739 Mon Sep 17 00:00:00 2001 From: MrYamous Date: Sat, 1 Apr 2023 11:58:55 +0200 Subject: [PATCH] complement lazy service autowiring --- service_container/lazy_services.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/service_container/lazy_services.rst b/service_container/lazy_services.rst index ac859958f19..8271fc84800 100644 --- a/service_container/lazy_services.rst +++ b/service_container/lazy_services.rst @@ -120,6 +120,15 @@ You can also configure laziness when your service is injected with the } } +This attribute also allows you to define the interfaces to proxy when using +laziness, and supports lazy-autowiring of intersection types:: + + public function __construct( + #[Autowire(service: 'foo', lazy: FooInterface::class)] + FooInterface|BarInterface $foo, + ) { + } + .. versionadded:: 6.3 The ``lazy`` argument of the ``#[Autowire()]`` attribute was introduced in