Bug report
Code snippet that reproduces the problem
https://phpstan.org/r/ede7535a-4964-4b38-bbfe-c5d5c8cc1571
Expected output
The expectation was that the dumped type would result in 30|0 or int if it's generalised. Similar to psalm
Instead what we're getting is a union of all the types in the array, which then requires doc blocks or assertions I was hoping to avoid.
Did PHPStan help you today? Did it make you happy in any way?
I've been able to wipe out a host of potential bugs while also providing more safety around generic classes, so yeah, this has made me very happy 😄
Side note, I'd be happy to take a stab at looking at resolving this with some pointers, I've tried to grok the codebase but couldn't nail down the right place to look for something like this.
Bug report
Code snippet that reproduces the problem
https://phpstan.org/r/ede7535a-4964-4b38-bbfe-c5d5c8cc1571
Expected output
The expectation was that the dumped type would result in
30|0orintif it's generalised. Similar to psalmInstead what we're getting is a union of all the types in the array, which then requires doc blocks or assertions I was hoping to avoid.
Did PHPStan help you today? Did it make you happy in any way?
I've been able to wipe out a host of potential bugs while also providing more safety around generic classes, so yeah, this has made me very happy 😄
Side note, I'd be happy to take a stab at looking at resolving this with some pointers, I've tried to grok the codebase but couldn't nail down the right place to look for something like this.