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

[DI] Introduce "container.service_locator" tag, replaces ServiceLocatorArgument#22024

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

@nicolas-grekas
Copy link
Member

@nicolas-grekasnicolas-grekas commentedMar 16, 2017
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no (master only)
Deprecations?no
Tests pass?yes
Fixed tickets-
LicenseMIT
Doc PR-

I first started working on adding this new "container.service_locator" tag, so here it is.
It allows defining and dumping service-locator services properly, where it wasn't possible previously (you had to create a DI extension to do so.)

Then I realized that this allowed us to entirely dropServiceLocatorArgument and replace it with the more flexibleServiceClosureArgument.

This makes things simpler overall, see diff stat.

chalasr, GuilhemN, linaori, and Koc reacted with thumbs up emoji
@nicolas-grekasnicolas-grekas added this to the3.3 milestoneMar 16, 2017
@nicolas-grekasnicolas-grekasforce-pushed thedi-service-locator-tag branch 5 times, most recently fromec2285b tod097928CompareMarch 16, 2017 15:14
Copy link
Member

@chalasrchalasr left a comment

Choose a reason for hiding this comment

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

Makes good sense to me 👍

Copy link
Contributor

@GuilhemNGuilhemN left a comment

Choose a reason for hiding this comment

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

👍

<argumentkey="session"type="service"id="session"on-invalid="null" />
<argumenttype="service">
<serviceclass="Symfony\Component\DependencyInjection\ServiceLocator">
<tagname="service_locator" />
Copy link
Member

Choose a reason for hiding this comment

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

Almost all other tags are of the "X.Y" form. Not sure if we need to call itcontainer.service_locator.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

tag renamed to container.service_locator

@nicolas-grekasnicolas-grekas changed the title[DI] Introduce "service_locator" tag, replaces ServiceLocatorArgument[DI] Introduce "container.service_locator" tag, replaces ServiceLocatorArgumentMar 17, 2017
@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commit5d230b5 intosymfony:masterMar 17, 2017
fabpot added a commit that referenced this pull requestMar 17, 2017
…es ServiceLocatorArgument (nicolas-grekas)This PR was merged into the 3.3-dev branch.Discussion----------[DI] Introduce "container.service_locator" tag, replaces ServiceLocatorArgument| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no (master only)| Deprecations? | no| Tests pass?   | yes| Fixed tickets | -| License       | MIT| Doc PR        | -I first started working on adding this new "container.service_locator" tag, so here it is.It allows defining and dumping service-locator services properly, where it wasn't possible previously (you had to create a DI extension to do so.)Then I realized that this allowed us to entirely drop `ServiceLocatorArgument` and replace it with the more flexible `ServiceClosureArgument`.This makes things simpler overall, see diff stat.Commits-------5d230b5 [DI] Introduce "container.service_locator" tag, replaces ServiceLocatorArgument
@sstok
Copy link
Contributor

If you always useDefinition to define a ServiceLocator would it make sense to addServiceLocatorDefinition of sorts? So you don't have to remember adding the tag every time.

sstok added a commit to rollerworks/PasswordStrengthBundle that referenced this pull requestMar 18, 2017
This PR was merged into the 1.5-dev branch.Discussion----------Related tosymfony/symfony#22024Let's hope I don't have to fix this again 😅Commits-------2fa6076 Fix tests failure for Symfony 3.3-dev
@nicolas-grekasnicolas-grekas deleted the di-service-locator-tag branchMarch 19, 2017 09:55
@nicolas-grekas
Copy link
MemberAuthor

nicolas-grekas commentedMar 19, 2017
edited
Loading

@sstok addingServiceLocatorDefinition would create a new type, unwanted to me. A helper method would do the job equally well. But right now, I don't feel the need for one personally.

sstok reacted with thumbs up emoji

sstok added a commit to rollerworks/RollerworksSearchBundle that referenced this pull requestMar 19, 2017
This PR was merged into the 2.0-dev branch.Discussion----------| Q             | A| ------------- | ---| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | | License       | MITSymfony 3.3-dev changed the way how ServiceLocators are registeredsymfony/symfony#22024Commits-------e2c028b Fix compatibility for latest Symfony version
@fabpotfabpot mentioned this pull requestMay 1, 2017
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull requestMay 4, 2017
…guiluz)This PR was merged into the master branch.Discussion----------[DI] Add section about service locatorsAdds documentation forsymfony/symfony#21553 andsymfony/symfony#22024.Any suggestion will be much appreciated, as usual.Commits-------fa19770 Fix service locator declarationf5e4942 Rewords5efacd0 [DI] Add section about Service Locators
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot left review comments

@chalasrchalasrchalasr approved these changes

+1 more reviewer

@GuilhemNGuilhemNGuilhemN approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

5 participants

@nicolas-grekas@fabpot@sstok@GuilhemN@chalasr

[8]ページ先頭

©2009-2025 Movatter.jp