Uh oh!
There was an error while loading. Please reload this page.
Add TraceableMessageBus stub with typed getDispatchedMessages() - #474
Conversation
VincentLanglet
commented
Feb 19, 2026
Hi @pscheit, Thanks for the PR. It's a good way to validate that the phpdoc added is right. Then it can still be added here for previous versions. |
pscheit
commented
Feb 19, 2026
hey @VincentLanglet thanks for the info, last time I did this there was this policy at symfony that they would never add array shapes xD |
VincentLanglet
commented
Feb 19, 2026
I cannot be sure about array shapes but I added conditional types and template type on symfony code base so i think it's worth trying. |
pscheit
commented
Feb 19, 2026
I'll give it a try :) |
stof
commented
Feb 19, 2026
I'm not sure those stubs should be added, as they would override any type defined in Symfony itself (and could become outdated if future Symfony versions add more things in the shape) |
VincentLanglet
commented
Feb 19, 2026
This already have been the strategy for previous symfony stubs so I don't see a reason doing it differently for this one. The issue is that Symfony only accepts those PHPDoc improvement as feature on the latest branch and
The way I see it, phpstan/phpstan-symfony solved those issues, and if the shape is outdated we can still fix it. Maybe some times, old stubs should be deleted here when they are old-enough fixed on symfony side. |
staabm
commented
Feb 19, 2026
we might even include some stubs depending on the symfony version we can detect from composer locks |
stof
commented
Feb 19, 2026
And this is based on the impact of those stubs that I'm making this feedback. We shipped a lot of type improvement in Symfony 7.3 and 7.4, and most of them were overridden by some stubs for users of phpstan-symfony.
I agree. But #431 is not implemented yet. |
VincentLanglet
commented
Apr 22, 2026
Hi ; sorry for the delay. Can you rebase ? Also since #481 is merged ; could you add the stub conditionally for version lower than 8.1 ? Thanks |
444aa95 to
acd0be8Comparepscheit
commented
Apr 24, 2026
hey Vincent, yes sorry i lost track here, too :) rebased on 2.0.x and made the stub conditionally load |
acd0be8 to
99bd527CompareUh oh!
There was an error while loading. Please reload this page.
staabm
commented
Apr 24, 2026
Thank you! |
This adds stubs for the TraceableMessageBus to make it easier to write tests using this class.