Bruce Weirdan

Results 291 comments of Bruce Weirdan

Can you provide the example of desired behavior using `array_filter`? This: https://psalm.dev/r/e24db6727c results in pretty much the same issues emitted as in your example with `Collection::filter()`

Psalm provider for `array_filter`: https://github.com/vimeo/psalm/blob/master/src/Psalm/Internal/Provider/ReturnTypeProvider/ArrayFilterReturnTypeProvider.php

I knew this would come up sooner or later :laughing:. Long story short, implementing this with any degree of robustness would require creating mini-Psalm for DQL queries. Not entirely impossible,...

What you could do instead is to specify the result type manually like this: ```php /** @var BlogPost[] $result */ $result = $query->getResult(); ``` Of course it becomes your responsibility...

No, foreach wouldn't work like that (see vimeo/psalm#649), but I have even better idea: https://getpsalm.org/r/7396e44181 It doesn't work right now either, though. I've reported the issue here: vimeo/psalm#1227. Fingers crossed...

Doesn't Doctrine compile those annotations to some machine-readable readable format? I guess it would be easier to work with that (with automatic recompilation, if necessary) instead of replicating the parsing...

I had this idea when I started this plugin, but I stopped being a Doctrine user before I got to that.

> It does when the metadata cache is activated (which is usually not the case in dev environments). If there's a standard way to invoke it the plugin could do...

> Thanks for writing this up as a clear feature request. That's implemented already: https://packagist.org/packages/roave/you-are-using-it-wrong