Skip to content

Commit

Permalink
Add an example of the specific method in the interface docblock
Browse files Browse the repository at this point in the history
  • Loading branch information
sroze committed Apr 24, 2018
1 parent 9e7a97c commit 06f1eae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ interface MessageSubscriberInterface extends MessageHandlerInterface
* [SecondMessage::class, -10],
* ];
*
* It can also specify a method and/or a priority per message:
*
* return [
* FirstMessage::class => 'firstMessageMethod',
* SecondMessage::class => ['secondMessageMethod', 20],
* ];
*
* The `__invoke` method of the handler will be called as usual with the message to handle.
*
* @return array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,10 +414,12 @@ public static function getHandledMessages(): array
}

public function dummyMethod()
{}
{
}

public function secondMessage()
{}
{
}
}

class HandlerMappingWithNonExistentMethod implements MessageSubscriberInterface
Expand Down

0 comments on commit 06f1eae

Please sign in to comment.