-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Messenger] Add HandlerArgumentsStamp #45418
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
Hey! To help keep things organized, we don't allow "Draft" pull requests. Could you please click the "ready for review" button or close this PR and open a new one when you are done? Note that a pull request does not have to be "perfect" or "ready for merge" when you first open it. We just want it to be ready for a first review. Cheers! Carsonbot |
Can I get some feedback on this feature? |
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.
LGTM
src/Symfony/Component/Messenger/Stamp/HandlerArgumentsStamp.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Messenger/Middleware/HandleMessageMiddleware.php
Outdated
Show resolved
Hide resolved
62cb367
to
efefa83
Compare
@fabpot Thanks for the review. I changed the code according to your comments and added a test. The CI failure seems unrelated. Status: Needs review |
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.
Just a small code change to make it more consistent with the rest of Symfony.
src/Symfony/Component/Messenger/Stamp/HandlerArgumentsStamp.php
Outdated
Show resolved
Hide resolved
@fabpot Updated. Is it okay to keep the promoted property or should I use the non-promoted syntax? |
63aac08
to
7130126
Compare
7130126
to
d081267
Compare
Tests are failing but once again I don't think it's related to my code. I squashed everything into a single commit. Also added a documentation PR. |
Thank you @enumag. |
This PR was submitted for the 6.2 branch but it was merged into the 6.3 branch instead. Discussion ---------- [Messenger] HandlerArgumentsStamp Refs * symfony/symfony#45418 Commits ------- 756a0ca [Messenger] HandlerArgumentsStamp
What is the reasoning behind making the stamp implement a |
As discussed in #31075 sometimes it's desirable for the messenger handler to receive additional argument than just the message itself. I understand the voiced concerns about passing the entire envelope but instead of that we could use the approach from this PR which doesn't add any additional arguments by default but is actually even more powerful since it gives the user full control what should be sent to the handler if desired.
This is just a prototype of course. With #45377 in mind I used a readonly property from PHP 8.1 but of course such details can be easily adjusted.
Let me know if such feature is wanted in Symfony. If yes then I'll add tests and a doc PR.