-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
2a3c02a
to
1358007
Compare
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.
👍
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? |
1358007
to
5aa4a24
Compare
Note added as a test case.
The other implementations of ServiceSubscriberInterface are all in bundles,
where DI is already a requirement.
Ready.
|
<argument type="service" id="container" /> | ||
<argument type="service"> | ||
<service class="Symfony\Component\DependencyInjection\ServiceLocator"> | ||
<tag name="container.service_locator" /> |
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.
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 ?
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.
That's an issue when using findTaggedServiceIds
, but ServiceLocatorTagPass
visits recursively all definitions by using AbstractRecursivePass
, so it works :)
|
@GromNaN These classes are abstract and missed the
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. |
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.
👍
Status: reviewed |
5aa4a24
to
7cd90f5
Compare
Thank you @nicolas-grekas. |
…*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
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?