Commit 811cce7
committed
minor symfony#52915 [Messenger] Fix missing
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@throws phpdoc on MiddlewareInterface, MessageBusInterface and SenderInterface (VincentLanglet)File tree
3 files changed
+10
-0
lines changed- src/Symfony/Component/Messenger
- Middleware
- Transport/Sender
3 files changed
+10
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
21 | 25 | | |
22 | 26 | | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
0 commit comments