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
The text was updated successfully, but these errors were encountered:
ruudk
changed the title
[Bleeding edge] Variable $body on left side of ?? is always null.
[Bleeding edge 0.12.83] Variable $body on left side of ?? is always null.
Apr 6, 2021
Fixed by some previous commit, but I also added "dynamic throw type extensions" so that PHPStan understands when json_encode and decode throw an exception and when they don't: phpstan/phpstan-src@2bf30bf
Bug report
I've read https://phpstan.org/blog/precise-try-catch-finally-analysis and I think it's related to my issue.
Why is PHPStan so certain that
$body
will always benull
? In my opinion, it can still be non-null ifsendRequest
does not throw butjson_decode
does.Code snippet that reproduces the problem
https://phpstan.org/r/bd38b020-3e40-4a08-9032-9ba63ea3a40d
Expected output
No error.
The text was updated successfully, but these errors were encountered: