Add TraceableMessageBus stub with typed getDispatchedMessages()#474
Add TraceableMessageBus stub with typed getDispatchedMessages()#474pscheit wants to merge 1 commit intophpstan:2.0.xfrom
Conversation
|
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. |
|
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 |
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. |
|
I'll give it a try :) |
|
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) |
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. |
|
we might even include some stubs depending on the symfony version we can detect from composer locks |
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. |
This adds stubs for the TraceableMessageBus to make it easier to write tests using this class.