Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[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

Merged

Conversation

sroze
Copy link
Contributor

@sroze sroze commented Aug 26, 2018

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.

@sroze sroze force-pushed the allow-interfaces-to-be-register-to-handle-message branch from a2f6bd9 to 9349f3f Compare August 26, 2018 14:09
sroze added a commit to sroze/messenger-workshop that referenced this pull request Aug 26, 2018
@nicolas-grekas nicolas-grekas added this to the next milestone Aug 27, 2018
}

foreach (class_implements($class, false) as $interface) {
if ($handler = $this->resolveFromClass($interface)) {
Copy link
Member

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?

Copy link
Contributor Author

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 💃)

@sroze sroze force-pushed the allow-interfaces-to-be-register-to-handle-message branch from 9349f3f to 2dbbfbd Compare August 27, 2018 11:46
@fabpot
Copy link
Member

fabpot commented Aug 29, 2018

Thank you @sroze.

@fabpot fabpot merged commit 2dbbfbd into symfony:master Aug 29, 2018
fabpot added a commit that referenced this pull request Aug 29, 2018
… (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
@nicolas-grekas
Copy link
Member

This BR is breaking the C.I. for the 4.1 branch, see e.g. https://travis-ci.org/symfony/symfony/jobs/421969557

nicolas-grekas added a commit that referenced this pull request Sep 1, 2018
…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
@javiereguiluz
Copy link
Member

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!

fabpot added a commit that referenced this pull request Sep 8, 2018
… 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
sroze added a commit to sroze/messenger-workshop that referenced this pull request Sep 21, 2018
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.2 Nov 1, 2018
This was referenced Nov 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants