Skip to content

Commit 4abb61d

Browse files
committed
minor #18153 [DependencyInjection] Add support for #[Autowire(lazy: class-string)] (MrYamous)
This PR was merged into the 6.3 branch. Discussion ---------- [DependencyInjection] Add support for `#[Autowire(lazy: class-string)]` In addition to issue #18095 / pr #18106 to explicitly document symfony/symfony#49836 Commits ------- 1fd4f07 complement lazy service autowiring
2 parents 5f4d3f7 + 1fd4f07 commit 4abb61d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

service_container/lazy_services.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,15 @@ You can also configure laziness when your service is injected with the
120120
}
121121
}
122122

123+
This attribute also allows you to define the interfaces to proxy when using
124+
laziness, and supports lazy-autowiring of intersection types::
125+
126+
public function __construct(
127+
#[Autowire(service: 'foo', lazy: FooInterface::class)]
128+
FooInterface|BarInterface $foo,
129+
) {
130+
}
131+
123132
.. versionadded:: 6.3
124133

125134
The ``lazy`` argument of the ``#[Autowire()]`` attribute was introduced in

0 commit comments

Comments
 (0)