Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Messenger] HandlerArgumentsStamp#17174

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
OskarStark merged 1 commit intosymfony:6.3fromenumag:patch-4
Aug 14, 2023
Merged

Conversation

@enumag
Copy link
Contributor

@enumagenumag commentedAug 14, 2022
edited by OskarStark
Loading

@carsonbotcarsonbot added this to the6.2 milestoneAug 14, 2022
fabpot added a commit to symfony/symfony that referenced this pull requestAug 14, 2022
This PR was merged into the 6.2 branch.Discussion----------[Messenger] Add HandlerArgumentsStamp| Q             | A| ------------- | ---| Branch?       | 6.2| Bug fix?      | no| New feature?  | yes| Deprecations? | no| Tickets       |Fix#31075| License       | MIT| Doc PR        |symfony/symfony-docs#17174As 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.Commits-------d081267 Add HandlerArgumentsStamp
@alexislefebvre
Copy link
Contributor

Can you please add an example of code?

I think it also need a note to say that it was added since Symfony 6.2.

@OskarStark
Copy link
Contributor

friendly ping@enumag

@enumag
Copy link
ContributorAuthor

enumag commentedNov 4, 2022
edited
Loading

Code sample and version note added.

@enumagenumagforce-pushed thepatch-4 branch 5 times, most recently from52a946f to187f63fCompareNovember 4, 2022 09:25
messenger.rst Outdated
It's possible to have messenger pass additional data to the message handler using the
:class:`Symfony\\Component\\Messenger\\Stamp\\HandlerArgumentsStamp`. Add this stamp to
the envelope in a middleware and fill it with any additional data you want to have
available in the handler.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
available in the handler.
available in the handler::

messenger.rst Outdated
}
}

Then your handler will look like this:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
Then your handler will look like this:
Then your handler will look like this::

messenger.rst Outdated

..versionadded::6.2

The HandlerArgumentsStamp was introduced in Symfony 6.2.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
The HandlerArgumentsStamp was introduced in Symfony 6.2.
The:class:`Symfony\\Component\\Messenger\\Stamp\\HandlerArgumentsStamp` was introduced in Symfony 6.2.

@OskarStarkOskarStark changed the base branch from6.2 to6.3August 14, 2023 08:01
@OskarStark
Copy link
Contributor

It took time, but here we go, this is in now. Thank you very much Jáchym.

@OskarStarkOskarStark merged commit3da709d intosymfony:6.3Aug 14, 2023
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@OskarStarkOskarStarkOskarStark approved these changes

+1 more reviewer

@MrYamousMrYamousMrYamous left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

6.3

Development

Successfully merging this pull request may close these issues.

5 participants

@enumag@alexislefebvre@OskarStark@MrYamous@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp