-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[DependencyInjection] Add #[Lazy]
attribute
#19506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
#[Lazy]
attribute
service_container/lazy_services.rst
Outdated
// ... | ||
} | ||
|
||
This attribute can be used on a class or on a parameter which should be lazy-loaded, and has a ``lazy`` parameter |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this part:
and has a ``lazy`` parameter that also supports defining interfaces to proxy and intersection types::
What's the purpose of the lazy
option? (which, by the way, looks like a bad option name to me because the attribute is also called lazy
)_. Is "type intersection" related to lazy
option in any way? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a compatibility issue, because the same param exists in both #[Autoconfigure]
and #[Autowire]
, and that way the parameter handling is the same.
I admit I'm not sure how to phrase this. But since this is the only parameter, maybe the name can be dropped in the example? Like:
and has a parameter that also supports defining interfaces to proxy and intersection types::
Upping this PR. I made modifications, is there anything else I can do to improve it? @javiereguiluz @alexandre-daubois |
b17bd5f
to
6f05767
Compare
Thanks Benjamin! This is now merged. |
Fixes #19486
Documentation for the new
#[Lazy]
attribute.