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] Activation middleware decorator#27320

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
sroze merged 1 commit intosymfony:masterfromogizanagi:messenger/activation_middleware_decorator
Jul 8, 2018
Merged

[Messenger] Activation middleware decorator#27320

sroze merged 1 commit intosymfony:masterfromogizanagi:messenger/activation_middleware_decorator
Jul 8, 2018

Conversation

@ogizanagi
Copy link
Contributor

@ogizanagiogizanagi commentedMay 20, 2018
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed ticketspart of#26901
LicenseMIT
Doc PRTODO:symfony/symfony-docs#10035

A small middleware decorator that can be wired using DI decoration to enable/disable a middleware on an arbitrary condition. This can be used to keep the same middleware stack across env but enable/disable some of them through this.

@sroze
Copy link
Contributor

How would someone use it? Manually, as in registers a service thatdecorates the generated middleware?

@ogizanagi
Copy link
ContributorAuthor

@sroze : Exactly. It'll just leverage DI capabilities.

Copy link
Contributor

@srozesroze left a comment

Choose a reason for hiding this comment

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

Makes sense to me 👍 (we definitely need a documentation PR for this though :))

/**
* @param Envelope $message
*/
public function handle($message, callable $next)
Copy link
Contributor

Choose a reason for hiding this comment

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

PHP allows you to rename$message to$envelope here, right?

ogizanagi reacted with thumbs up emoji
Copy link
Member

@nicolas-grekasnicolas-grekas left a comment

Choose a reason for hiding this comment

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

LGTM, with one naming question.

* file that was distributed with this source code.
*/

namespace Symfony\Component\Messenger\Middleware\Enhancers;

Choose a reason for hiding this comment

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

Is theEnhancers sub-namespace required? Nesting hurts discovery IMHO, better remove it?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

This was mainly echoingSymfony\Component\Messenger\Transport\Enhancers which are decorators. But of course I'm fine with removing this namespace.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd keep it that way; it helps when exploring the code base I believe.

@sroze
Copy link
Contributor

Thank you@ogizanagi.

@srozesroze merged commit6e43838 intosymfony:masterJul 8, 2018
sroze added a commit that referenced this pull requestJul 8, 2018
This PR was merged into the 4.2-dev branch.Discussion----------[Messenger] Activation middleware decorator| Q             | A| ------------- | ---| Branch?       | master <!-- see below -->| Bug fix?      | no| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md files -->| BC breaks?    | no     <!-- seehttps://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 | part of#26901   <!-- #-prefixed issue number(s), if any -->| License       | MIT| Doc PR        | TODOA small middleware decorator that can be wired using DI decoration to enable/disable a middleware on an arbitrary condition. This can be used to keep the same middleware stack across env but enable/disable some of them through this.Commits-------6e43838 [Messenger] Activation middleware decorator
@ogizanagiogizanagi deleted the messenger/activation_middleware_decorator branchJuly 8, 2018 09:27
@kbond
Copy link
Member

Is there a doc PR for this?

@ogizanagi
Copy link
ContributorAuthor

ogizanagi commentedJul 9, 2018
edited
Loading

@kbond : Not yet. Feel free to open one if you want. Otherwise it'll go in my TODO list anyway :)

EDIT: I've createdsymfony/symfony-docs#10035 to help

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

+1 more reviewer

@srozesrozesroze approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.2

Development

Successfully merging this pull request may close these issues.

5 participants

@ogizanagi@sroze@kbond@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp