Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork5.3k
[DependencyInjection] Add section about Service Closures#15730
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
Uh oh!
There was an error while loading.Please reload this page.
Conversation
374088f to0da6fc7Compare…-DSL (HypeMC)This PR was merged into the 5.4 branch.Discussion----------[DependencyInjection] Add service_closure() to the PHP-DSL| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | no| New feature? | yes| Deprecations? | no| Tickets | -| License | MIT| Doc PR |symfony/symfony-docs#15730 andsymfony/symfony-docs#15731Adds a `service_closure()` function to the PHP-DSL.Commits-------f333fa0 [DI] Add service_closure() to the PHP-DSL
…-DSL (HypeMC)This PR was merged into the 5.4 branch.Discussion----------[DependencyInjection] Add service_closure() to the PHP-DSL| Q | A| ------------- | ---| Branch? | 5.4| Bug fix? | no| New feature? | yes| Deprecations? | no| Tickets | -| License | MIT| Doc PR |symfony/symfony-docs#15730 andsymfony/symfony-docs#15731Adds a `service_closure()` function to the PHP-DSL.Commits-------f333fa0e05 [DI] Add service_closure() to the PHP-DSL
HeahDude left a comment
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.
Thank you for documenting this!
| /** | ||
| * @var \Closure | ||
| */ | ||
| private $mailer; |
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.
| /** | |
| * @var\Closure | |
| */ | |
| private $mailer; | |
| /** | |
| * @varcallable(): MailerInterface | |
| */ | |
| private\Closure$mailer; |
?
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.
Done.
Uh oh!
There was an error while loading.Please reload this page.
| $services = $configurator->services(); | ||
| $services->set(MyService::class) | ||
| ->args([new ServiceClosureArgument(new Reference('mailer'))]); |
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.
Note to mergers: this should be updated to:
| ->args([new ServiceClosureArgument(new Reference('mailer'))]); | |
| ->args([service_closure('mailer')]); |
when merged up in 5.4.
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.
There's a separate PR for that#15731
Uh oh!
There was an error while loading.Please reload this page.
722e76e to73125eeCompareOskarStark commentedMar 2, 2023
As 4.4 is not maintained anymore we should only work on 5.4, can you merge the two PRs? |
HypeMC commentedMar 2, 2023
@OskarStark Done,#15731 should be good to go. |
Documents service closures added insymfony/symfony#21770 andsymfony/symfony#41176.