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

[HttpKernel] Dont implement ServiceSubscriberInterface on *SessionListener#22207

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
fabpot merged 1 commit intosymfony:masterfromnicolas-grekas:di-sersub
Mar 31, 2017

Conversation

@nicolas-grekas
Copy link
Member

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

QA
Branch?master
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets#22171,silexphp/Silex#1496
LicenseMIT
Doc PR-

ImplementingServiceSubscriberInterface creates a dep on the DI component, which Silex can't afford. Let's revert that part.

@GromNaN can you please confirm this fixes your issue?

GromNaN reacted with confused emoji
@nicolas-grekasnicolas-grekas added this to the3.3 milestoneMar 28, 2017
@nicolas-grekasnicolas-grekas changed the title[HttpKernel] Dont implement ServiceSubscriberInterface on *SessionLis…[HttpKernel] Dont implement ServiceSubscriberInterface on *SessionListenerMar 28, 2017
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.

👍

@fabpot
Copy link
Member

I would add a note somewhere in the code or in the XML service definition to avoid breaking this again in the future. Can we also check that we don't have any other similar issues?

@nicolas-grekas
Copy link
MemberAuthor

nicolas-grekas commentedMar 29, 2017 via email

Note added as a test case.The other implementations of ServiceSubscriberInterface are all in bundles,where DI is already a requirement.Ready.

<argumenttype="service"id="container" />
<argumenttype="service">
<serviceclass="Symfony\Component\DependencyInjection\ServiceLocator">
<tagname="container.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.

AFAIK, tagging anonymous services inside an argument does not work, as this Definition is not registered directly in the container (well, I think the XMLFileLoader converts inlined definition to normal private services with a random id, which is why it works here, but creating an inlined definition in PHP would not work as it would stay inline). Should we keep it like this ?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

That's an issue when usingfindTaggedServiceIds, butServiceLocatorTagPass visits recursively all definitions by usingAbstractRecursivePass, so it works :)

@GromNaN
Copy link
Member

Removing theServiceSubscriberInterface solves the issue of having a hard dependency to the DI component. But ...

@chalasr
Copy link
Member

chalasr commentedMar 29, 2017
edited
Loading

@GromNaN These classes are abstract and missed theAbstract prefix. There is no gain in adding it apart from making them consistent with others by convention. The thing is that we moved concrete implementations from the framework to the component. These classes being named the same as their abstract parent, we grabbed the opportunity for renaming which is fine I think.

What is the purpose of the abstract classes if overloading method can be done in subclass

The added implementations are useful on their own. A day Silex could use a PSR-11 container and remove their concrete implementations in favor of them.

About the change reverted here, these classes can live without. New features are used in the core as possible, but it's not worth breaking consumers code nor forcing them to require a new component.

Copy link
Member

@stofstof left a comment

Choose a reason for hiding this comment

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

👍

@stof
Copy link
Member

Status: reviewed

@fabpot
Copy link
Member

Thank you@nicolas-grekas.

@fabpotfabpot merged commit7cd90f5 intosymfony:masterMar 31, 2017
fabpot added a commit that referenced this pull requestMar 31, 2017
…*SessionListener (nicolas-grekas)This PR was merged into the 3.3-dev branch.Discussion----------[HttpKernel] Dont implement ServiceSubscriberInterface on *SessionListener| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets |#22171,silexphp/Silex#1496| License       | MIT| Doc PR        | -Implementing `ServiceSubscriberInterface` creates a dep on the DI component, which Silex can't afford. Let's revert that part.@GromNaN can you please confirm this fixes your issue?Commits-------7cd90f5 [HttpKernel] Dont implement ServiceSubscriberInterface on *SessionListener
@nicolas-grekasnicolas-grekas deleted the di-sersub branchApril 3, 2017 11:52
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof approved these changes

@chalasrchalasrchalasr approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

3.3

Development

Successfully merging this pull request may close these issues.

6 participants

@nicolas-grekas@fabpot@GromNaN@chalasr@stof@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp