Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[DependencyInjection] Add service_closure() to the PHP-DSL#42625
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
[DependencyInjection] Add service_closure() to the PHP-DSL#42625
Uh oh!
There was an error while loading.Please reload this page.
Conversation
| ->args([service_closure(service('foo'))]); | ||
| $s->set('service_closure_invalid', 'Bar') | ||
| ->args([service_closure(service('invalid_service')->nullOnInvalid())]); |
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'd be great to be able to do this instead:service_closure('invalid_service')->nullOnInvalid()
maybe with a newClosureReferenceConfigurator?
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.
@nicolas-grekas Done. The fabbot failure is unrelated to my changes, I can apply it if you want.
fabpot commentedAug 18, 2021
@HypeMC Can you submit a PR on the docs? Or at least, give a full usage example in the PR description to help the doc team? Thank you. |
HypeMC commentedAug 18, 2021
@fabpot Sure, I'll submit a PR sometime tomorrow. |
HypeMC commentedAug 19, 2021
@fabpot PR(s) on the docs added:symfony/symfony-docs#15730 andsymfony/symfony-docs#15731 |
nicolas-grekas commentedAug 20, 2021
Thank you@HypeMC. |
…es (HypeMC)This PR was merged into the 5.4 branch.Discussion----------[DependencyInjection] Add section about Service ClosuresDocuments service closures added insymfony/symfony#21770 andsymfony/symfony#41176, and the `service_closure()` PHP-DSL function added insymfony/symfony#42625 .Commits-------f2b2fdb [DI] Add section about Service Closures
Uh oh!
There was an error while loading.Please reload this page.
Adds a
service_closure()function to the PHP-DSL.