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] Allow injecting tagged iterator as service locator arguments#43015

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

Merged

Conversation

IonBazan
Copy link
Contributor

@IonBazanIonBazan commentedSep 14, 2021
edited
Loading

QA
Branch?5.4
Bug fix?no
New feature?yes
Deprecations?no
Tickets-
LicenseMIT
Doc PRsymfony/symfony-docs#15821

Not sure if this is a feature or bug fix - kindly update the description and target branch and I will backport the changes for older version if needed.
This feature allows creating a named (reusable) service locator using tagged services:

services:_instanceof:App\Command\HandlerInterface:tags:['app.command_handler']app.command_handlers:class:Symfony\Component\DependencyInjection\ServiceLocatorarguments:[!tagged_iterator { tag: 'app.command_handler', default_index_method: 'getCommandName' }]App\CommandBus:arguments:['@app.command_handlers']App\AnotherCommandBus:arguments:['@app.command_handlers']

Prior to this change, following error would be thrown:

Invalid definition for service "app.command_handlers": an array of references is expected as first argument when the "container.service_locator" tag is set.

@IonBazanIonBazan changed the titleAllow injecting tagged iterator as service locator arguments[DependencyInjection] Allow injecting tagged iterator as service locator argumentsSep 14, 2021
@derrabusderrabus added this to the5.4 milestoneSep 15, 2021
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

thanks
that's a new feature for sure
can you please have a look at the doc and submit a PR if possible?

@IonBazan
Copy link
ContributorAuthor

Sure, will look into that!

@nicolas-grekas
Copy link
Member

Thank you@IonBazan.

IonBazan reacted with rocket emoji

@nicolas-grekasnicolas-grekas merged commit2018f0c intosymfony:5.4Sep 17, 2021
@IonBazanIonBazan deleted the tagged-argument-locator branchSeptember 17, 2021 08:47
This was referencedNov 5, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@derrabusderrabusderrabus approved these changes

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
5.4
Development

Successfully merging this pull request may close these issues.

4 participants
@IonBazan@nicolas-grekas@derrabus@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp