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
File Http/Client/Request
method: data() and json()
The Methods both have the return type array (declared in PHPDoc @return array).
But there is a possibility that it returns null - in case of a non-valid json body.
json_decode will return null if the content cannot be decoded or the depth is to high.
so either the return type shall be changed to ?array or the json function should be extended like so
Laravel Version
10.13.5
PHP Version
8.2.x
Database Driver & Version
Mysql 5.7
Description
File Http/Client/Request
method: data() and json()
The Methods both have the return type array (declared in PHPDoc @return array).
But there is a possibility that it returns null - in case of a non-valid json body.
json_decode will return null if the content cannot be decoded or the depth is to high.
so either the return type shall be changed to ?array or the json function should be extended like so
It isn't a huge issue, but when using PHPStan and doing something like that:
it is always complaining about left part can never be null due to return values...
The text was updated successfully, but these errors were encountered: