Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[DependencyInjection] add#[AsFactory]
attribute#60589
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:7.4
Are you sure you want to change the base?
Conversation
e3fc70f
toe09532c
Comparee09532c
to52cdb9a
Comparezolex commentedMay 30, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
I like the feature and I know the But thinking about it a bit more: I believe it would be a better option to reuse the existing |
Hi@zolex, thanks for your comment ❤️ I really appreciate it 😄 |
Uh oh!
There was an error while loading.Please reload this page.
✅ Add
#[AsFactory]
Attribute for Declaring Factory ServicesThis PR introduces a new attribute:
#[AsFactory]
, which allows developers to declare a service factory directly on a class using attributes, instead of via configuration files.✅ Usage Example
Instead of configuring a factory in
services.yaml
:You can now use the attribute directly: