Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 58ef481

Browse files
committed
Remove passing envelope as second parameter
1 parent b2d6bc1 commit 58ef481

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Symfony/Component/Messenger/Middleware/HandleMessageMiddleware.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function handle(Envelope $envelope, StackInterface $stack): Envelope
4242
$handler = null;
4343
$message = $envelope->getMessage();
4444
foreach ($this->handlersLocator->getHandlers($envelope) as $alias => $handler) {
45-
$envelope = $envelope->with(HandledStamp::fromCallable($handler, $handler($message, $envelope), \is_string($alias) ? $alias : null));
45+
$envelope = $envelope->with(HandledStamp::fromCallable($handler, $handler($message), \is_string($alias) ? $alias : null));
4646
}
4747
if (null === $handler && !$this->allowNoHandlers) {
4848
throw new NoHandlerForMessageException(sprintf('No handler for message "%s".', \get_class($envelope->getMessage())));

src/Symfony/Component/Messenger/Tests/Middleware/HandleMessageMiddlewareTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testItCallsTheHandlerAndNextMiddleware()
3232
DummyMessage::class => array($handler),
3333
)));
3434

35-
$handler->expects($this->once())->method('__invoke')->with($message, $envelope);
35+
$handler->expects($this->once())->method('__invoke')->with($message);
3636

3737
$middleware->handle($envelope, $this->getStackMock());
3838
}

0 commit comments

Comments
 (0)