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

Skip to content

Commit 06f1eae

Browse files
committed
Add an example of the specific method in the interface docblock
1 parent 9e7a97c commit 06f1eae

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/Symfony/Component/Messenger/Handler/MessageSubscriberInterface.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ interface MessageSubscriberInterface extends MessageHandlerInterface
3232
* [SecondMessage::class, -10],
3333
* ];
3434
*
35+
* It can also specify a method and/or a priority per message:
36+
*
37+
* return [
38+
* FirstMessage::class => 'firstMessageMethod',
39+
* SecondMessage::class => ['secondMessageMethod', 20],
40+
* ];
41+
*
3542
* The `__invoke` method of the handler will be called as usual with the message to handle.
3643
*
3744
* @return array

src/Symfony/Component/Messenger/Tests/DependencyInjection/MessengerPassTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,10 +414,12 @@ public static function getHandledMessages(): array
414414
}
415415

416416
public function dummyMethod()
417-
{}
417+
{
418+
}
418419

419420
public function secondMessage()
420-
{}
421+
{
422+
}
421423
}
422424

423425
class HandlerMappingWithNonExistentMethod implements MessageSubscriberInterface

0 commit comments

Comments
 (0)