Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
Commit36f8fe5
committed
bug#43781 [Messenger] Fix
This PR was squashed before being merged into the 4.4 branch.Discussion----------[Messenger] Fix `TraceableMessageBus` implementation so it can compute caller even when used within a callback| Q | A| ------------- | ---| Branch? | 4.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Tickets || License | MIT| Doc PR |Quoting commits:>> This test shows that `array_map([new TraceableMessageBus(...), 'dispatch'], $messages)` does not work at all,> because `debug_backtrace()` is used in internals to compute the call-site, and it is not considering the fact> that the caller may be:>> * an internal PHP function> * a callback (this example test scenario)> * generated code (`eval()` result)>> The output of such a failure:>> ```> 1) Symfony\Component\Messenger\Tests\TraceableMessageBusTest::testItTracesExceptionsWhenMessageBusIsFiredFromArrayCallback> Undefined array key "line">> /app/src/Symfony/Component/Messenger/TraceableMessageBus.php:66> /app/src/Symfony/Component/Messenger/TraceableMessageBus.php:36> /app/src/Symfony/Component/Messenger/Tests/TraceableMessageBusTest.php:175> ```>> To be on the safe side, also removed `compact()` usage, which was making everything> much muddier and harder to comprehend.Commits-------1423229 [Messenger] Fix `TraceableMessageBus` implementation so it can compute caller even when used within a callbackTraceableMessageBus implementation so it can compute caller even when used within a callback (Ocramius)File tree
2 files changed
+26
-5
lines changed- src/Symfony/Component/Messenger
- Tests
2 files changed
+26
-5
lines changedLines changed: 18 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
159 | 177 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | | - | |
| 65 | + | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
101 | | - | |
| 100 | + | |
102 | 101 | | |
103 | | - | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
104 | 107 | | |
105 | 108 | | |
0 commit comments
Comments
(0)