You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IMO Dumped type: array<int|string, *ERROR*> is objectively wrong, since $items are certainly an array. (I'm not sure if *ERROR* makes sense here even if $items were non-iterable).
I'm not sure if this is a consequence of the first issue, or if this is intended behavior. But in any case, it is not what I would expect based on the documentation of treatPhpDocTypesAsCertain. My understanding is that it should allow me to double-check if I'm getting the type specified in phpdoc or not, but it should otherwise assume that the phpdoc is correct.
Bug report
I tried setting
treatPhpDocTypesAsCertain: false
and I got a bunch of weird issues reported. I eventually narrowed it down to this snippet: https://phpstan.org/r/31afc03c-8936-4cc4-b292-b48df3821292IMO
Dumped type: array<int|string, *ERROR*>
is objectively wrong, since$items
are certainly an array. (I'm not sure if*ERROR*
makes sense here even if$items
were non-iterable).And then there's the second issue:
I'm not sure if this is a consequence of the first issue, or if this is intended behavior. But in any case, it is not what I would expect based on the documentation of
treatPhpDocTypesAsCertain
. My understanding is that it should allow me to double-check if I'm getting the type specified in phpdoc or not, but it should otherwise assume that the phpdoc is correct.Code snippet that reproduces the problem
https://phpstan.org/r/31afc03c-8936-4cc4-b292-b48df3821292 (same as above)
Expected output
It should behave the same as with
treatPhpDocTypesAsCertain: true
:Dumped type: array<int, Item>
The text was updated successfully, but these errors were encountered: