8000 [Messenger] Allow AsMessageHandler attribute on methods by mjpvandenberg · Pull Request #45273 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Messenger] Allow AsMessageHandler attribute on methods #45273

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
merged 2 commits into from
Mar 26, 2022

Conversation

mjpvandenberg
Copy link
Contributor
Q A
Branch? 6.1
Bug fix? no
New feature? yes
Deprecations? no
Tickets none
License MIT
Doc PR tbd

Similar to the #[AsEventListener] attribute, this PR allows for using the #[AsMessageHandler] attribute on methods.

Combining class-level and method-level usage inside a single class is supported, as shown by the adapted MessengerPassTest::testTaggedMessageHandler test.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 6.1 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@mjpvandenberg
Copy link
Contributor Author

The low-deps tests for FrameworkBundle are failing because current 6.1 branch of Messenger does not allow the AsMessageHandler attribute on methods. Should I remove the change in the FrameworkBundle and save that for a later PR?

(The Psalm and Fabbot failures are not related to the changes in this PR.)

@carsonbot
Copy link

Hey!

I think @alirezamirsepassi has recently worked with this code. Maybe they can help review this?

Cheers!

Carsonbot

@fabpot fabpot force-pushed the method-message-handler branch from 7daf277 to fc19ed5 Compare March 26, 2022 16:08
@fabpot
Copy link
Member
fabpot commented Mar 26, 2022

The low-deps tests for FrameworkBundle are failing because current 6.1 branch of Messenger does not allow the AsMessageHandler attribute on methods. Should I remove the change in the FrameworkBundle and save that for a later PR?

(The Psalm and Fabbot failures are not related to the changes in this PR.)

I've fixed the deps issue to fix the tests.

@fabpot
Copy link
Member
fabpot commented Mar 26, 2022

Thank you @mjpvandenberg.

@fabpot fabpot merged commit b5b48c0 into symfony:6.1 Mar 26, 2022
@fabpot fabpot mentioned this pull request Apr 15, 2022
javiereguiluz added a commit to javiereguiluz/symfony-docs that referenced this pull request May 5, 2022
… methods (mjpvandenberg)

This PR was merged into the 6.1 branch.

Discussion
----------

[Messenger] AsMessageHandler can be used on class methods

Documents symfony/symfony#45273

Commits
-------

2bf52dd AsMessageHandler can be used on class methods
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.

3 participants
0