Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[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

Closed
HypeMC wants to merge1 commit intosymfony:4.4fromHypeMC:service-closure

Conversation

@HypeMC
Copy link
Member

Documents service closures added insymfony/symfony#21770 andsymfony/symfony#41176.

v-m-i and kahric reacted with thumbs up emoji
@carsonbotcarsonbot added this to the4.4 milestoneAug 19, 2021
@HypeMCHypeMCforce-pushed theservice-closure branch 3 times, most recently from374088f to0da6fc7CompareAugust 20, 2021 00:58
nicolas-grekas added a commit to symfony/symfony that referenced this pull requestAug 20, 2021
…-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
symfony-splitter pushed a commit to symfony/dependency-injection that referenced this pull requestAug 20, 2021
…-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
Copy link
Contributor

@HeahDudeHeahDude left a 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!

Comment on lines 22 to 25
/**
* @var \Closure
*/
private $mailer;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
/**
* @var\Closure
*/
private $mailer;
/**
* @varcallable(): MailerInterface
*/
private\Closure$mailer;

?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Done.

$services = $configurator->services();

$services->set(MyService::class)
->args([new ServiceClosureArgument(new Reference('mailer'))]);
Copy link
Contributor

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:

Suggested change
->args([new ServiceClosureArgument(new Reference('mailer'))]);
->args([service_closure('mailer')]);

when merged up in 5.4.

Copy link
MemberAuthor

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

@HypeMCHypeMCforce-pushed theservice-closure branch 2 times, most recently from722e76e to73125eeCompareOctober 1, 2022 18:43
@OskarStark
Copy link
Contributor

As 4.4 is not maintained anymore we should only work on 5.4, can you merge the two PRs?

@HypeMCHypeMC closed thisMar 2, 2023
@HypeMCHypeMC deleted the service-closure branchMarch 2, 2023 11:58
@HypeMC
Copy link
MemberAuthor

@OskarStark Done,#15731 should be good to go.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@OskarStarkOskarStarkOskarStark left review comments

+1 more reviewer

@HeahDudeHeahDudeHeahDude approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.4

Development

Successfully merging this pull request may close these issues.

4 participants

@HypeMC@OskarStark@HeahDude@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp