Skip to content
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

New Messenger Middleware Maker command #574

Merged
merged 1 commit into from
Apr 4, 2020

Conversation

zairigimad
Copy link
Contributor

@zairigimad zairigimad commented Mar 29, 2020

New Command to generate Middleware

capture

generated code :

CustomMiddleware
<?php
namespace App\Middleware;

use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Middleware\MiddlewareInterface;
use Symfony\Component\Messenger\Middleware\StackInterface;

final class CustomMiddleware implements MiddlewareInterface
{
     public function handle(Envelope $envelope, StackInterface $stack): Envelope
     {
         // ...
         return $stack->next()->handle($envelope, $stack);
     }
}

@zairigimad zairigimad force-pushed the feature/make-middleware branch 2 times, most recently from 85e08e0 to 44a618c Compare March 29, 2020 18:49
Copy link
Member

@weaverryan weaverryan left a comment

Choose a reason for hiding this comment

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

This is looking really good. We DO need at least one functional test for it (we have many examples). It would probably be pretty simple - just verify that the command runs... and that's probably it.

src/Maker/MakeMiddleware.php Outdated Show resolved Hide resolved
src/Maker/MakeMiddleware.php Outdated Show resolved Hide resolved
Copy link
Member

@weaverryan weaverryan left a comment

Choose a reason for hiding this comment

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

Very close now!

src/Maker/MakeMessengerMiddleware.php Show resolved Hide resolved
tests/Maker/MakeMessengerMiddlewareTest.php Outdated Show resolved Hide resolved
@weaverryan
Copy link
Member

Great work! Thank you very much for this @zairigimad!

@weaverryan weaverryan closed this in d1309e7 Apr 4, 2020
@weaverryan weaverryan merged commit d1309e7 into symfony:master Apr 4, 2020
@zairigimad
Copy link
Contributor Author

Great work! Thank you very much for this @zairigimad!

Thank you for your help @weaverryan :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants