Uh oh!
There was an error while loading. Please reload this page.
Specifiy json_decode default return type - #1283
Conversation
b31db0e to
d43c845Compareondrejmirtes
commented
May 4, 2022
I've rejected this idea in phpstan/phpstan-nette#89 (comment) and that's why I suggested to subtract from MixedType instead. |
herndlm
commented
May 4, 2022
ah I see, makes sense. ok then |
herndlm
commented
May 4, 2022
I always forget that adding more type information / getting rid of mixed will potentially lead to more errors below level 9. I instinctively want to get rid of mixed everywhere :D |
@herndlm like I changed in AccessPropertiesRule with additional check for object? I think.It's just not fixed yet :) |
rajyan
commented
May 4, 2022
I'll send a pull request for it! |
herndlm
commented
May 4, 2022
ok sounds interesting, just don't spend too much time on the json_decode case. since mixed or mixed~stdClass is returned it might not work. but that's fine :) |
rajyan
commented
May 4, 2022
My assumption was not correct... I'm not gonna try it now... |
so, in case of |
mixedis too vague IMO, this should be fine to specify with more details, see also https://3v4l.org/hEDjaBut please somebody double and triple check that I didn't miss anything here. Together with #993 this allows us to get rid of
stdClassfor example.I was also hoping that it would "fix" phpstan/phpstan#7073 but apparently
NonexistentOffsetInArrayDimFetchRuleis not happy with scalar null coalescing access. But not sure if that's coming from that rule or somewhere else CC @rajyan