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
I think this is an error on the phpstorm-stubs side, but that is mostly a guess after poking around a bit. If PHPStan is using the latest stubs I suspect the cause was JetBrains/phpstorm-stubs#1075, but I haven't been able to work out how to override the stub files in PHPStan - just downloading and modifying http3.php and including it in stubFiles doesn't appear to work.
PhpStorm itself seems happy with most of these (including those below) so I'm not sure if that should be fixed on the PHPStan side or in phpstorm-stubs, but PhpStorm can't resolve at least the ones in the Parser class (which makes sense as those are in a nested namespace) - so at least part of the fix seems to be on the stubs side.
I made a change to re-fully-qualify all the namespaces and PHPStan was certainly happier parsing it as a stub file, but without the ability to run the upstream tests (no Docker), being able to confirm it fixed the erroneous errors, or being sure it wouldn't be overwritten by the next attempt to unify the code style (if that PR was the cause), I didn't feel comfortable submitting a PR directly :)
pecl_http is of course fairly dead and I will probably aim to just delete the code using it (it is behind runtime checks and shouldn't be live, PHPStan is of course dutifully analysing it anyway though).
Expected output
I wouldn't expect any errors from this code.
Did PHPStan help you today? Did it make you happy in any way?
PHPStan helps me every day, at the moment it is helping me clean up 15 years of accumulated cruft.
The text was updated successfully, but these errors were encountered:
Bug report
I think this is an error on the phpstorm-stubs side, but that is mostly a guess after poking around a bit. If PHPStan is using the latest stubs I suspect the cause was JetBrains/phpstorm-stubs#1075, but I haven't been able to work out how to override the stub files in PHPStan - just downloading and modifying
http3.php
and including it instubFiles
doesn't appear to work.PhpStorm itself seems happy with most of these (including those below) so I'm not sure if that should be fixed on the PHPStan side or in phpstorm-stubs, but PhpStorm can't resolve at least the ones in the
Parser
class (which makes sense as those are in a nested namespace) - so at least part of the fix seems to be on the stubs side.I made a change to re-fully-qualify all the namespaces and PHPStan was certainly happier parsing it as a stub file, but without the ability to run the upstream tests (no Docker), being able to confirm it fixed the erroneous errors, or being sure it wouldn't be overwritten by the next attempt to unify the code style (if that PR was the cause), I didn't feel comfortable submitting a PR directly :)
JetBrains/phpstorm-stubs@master...asherkin:master
Code snippet that reproduces the problem
https://phpstan.org/r/885974be-633c-423c-8ea4-6b4917b88229
pecl_http
is of course fairly dead and I will probably aim to just delete the code using it (it is behind runtime checks and shouldn't be live, PHPStan is of course dutifully analysing it anyway though).Expected output
I wouldn't expect any errors from this code.
Did PHPStan help you today? Did it make you happy in any way?
PHPStan helps me every day, at the moment it is helping me clean up 15 years of accumulated cruft.
The text was updated successfully, but these errors were encountered: