You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
minor symfony#52915 [Messenger] Fix missing @throws phpdoc on MiddlewareInterface, MessageBusInterface and SenderInterface (VincentLanglet)
This PR was submitted for the 5.4 branch but it was squashed and merged into the 7.1 branch instead.
Discussion
----------
[Messenger] Fix missing ``@throws`` phpdoc on MiddlewareInterface, MessageBusInterface and SenderInterface
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes (kinda, it's missing phpdoc)
| New feature? | no
| Deprecations? | no
| Issues | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->
| License | MIT
``@throws`` phpdoc help the developper to know those methods can throw an exception and to have a contract about which exception can be thrown.
I recently got an exception in production because of the call `$messageBus->dispatch()` without knowing it could throw an exception. Seems like it's because it iterable on every Middleware and a lot of middleware are throwing exception.
As an example:
- https://github.com/symfony/symfony/blob/7.1/src/Symfony/Component/Messenger/Middleware/RejectRedeliveredMessageMiddleware.php#L38
- Almost every sender are throwing `TransportException` in case of errors, which happen in the SendMessageMiddleware.
Commits
-------
70a74b7 [Messenger] Fix missing ``@throws`` phpdoc on MiddlewareInterface, MessageBusInterface and SenderInterface
0 commit comments