-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Allow interfaces to be type-hinted as well #28271
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
[Messenger] Allow interfaces to be type-hinted as well #28271
Conversation
a2f6bd9
to
9349f3f
Compare
… (possible thanks to symfony/symfony#28271)
} | ||
|
||
foreach (class_implements($class, false) as $interface) { | ||
if ($handler = $this->resolveFromClass($interface)) { |
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.
not sure this needs to be recursive: class_implements
already returns all implemented interfaces
also, what about parents?
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.
No point of having it recursive, that's true; removed it and added handling of its parents (and the relevant tests, obsly 💃)
9349f3f
to
2dbbfbd
Compare
Thank you @sroze. |
… (sroze) This PR was merged into the 4.2-dev branch. Discussion ---------- [Messenger] Allow interfaces to be type-hinted as well | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #27076 | License | MIT | Doc PR | ø Interfaces can be type-hinted as well for the message handlers. Commits ------- 2dbbfbd Allow interfaces to be type-hinted as well
This BR is breaking the C.I. for the 4.1 branch, see e.g. https://travis-ci.org/symfony/symfony/jobs/421969557 |
…compiler pass in FWB (sroze) This PR was merged into the 4.1 branch. Discussion ---------- [Messenger][FrameworkBundle] Move commands-specifics to a compiler pass in FWB | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #28271 (comment) | License | MIT | Doc PR | ø We very recently [broke the tests](#28271 (comment)) by adding a legitimate BC-break in one of Messenger's command. The failure is on FrameworkBundle (on the 4.1 branch) when using the "latest" dependencies (so messenger on master): the XML configuration does not match anymore the class. Even though it makes sense to have most the compiler pass in the components, it does not make much sense to have things into them that are very coupled to what we defined in FWB' XML. This pull-request moves what is related to this command to the FWB directly. Commits ------- b5415ea Move commands-specifics to a compiler pass in FWB
I've created symfony/symfony-docs#10279 to document this new feature. Please, don't forget to create a doc issue for every new feature. Otherwise it's very complicated for the Docs team to keep track of all needed changes. Thanks! |
… not using a Container (fabpot) This PR was merged into the 4.2-dev branch. Discussion ---------- [Messenger] Add interfaces to be type-hinted even when not using a Container | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no <!-- see https://symfony.com/bc --> | Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tests pass? | yes <!-- please add some, will be required by reviewers --> | Fixed tickets | n/a | License | MIT | Doc PR | n/a This a follow-up to #28271. This adds #28271 to the non-container handler locator. Commits ------- 963fde9 [Messenger] added interfaces to be type-hinted even when not using a Container
… (possible thanks to symfony/symfony#28271)
Interfaces can be type-hinted as well for the message handlers.