New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memcached SASL support is assumed to be always true #6263
Comments
If you have this code:
And you add |
I'll reopen if you clarify what's going on here :) |
I'll try to create a reproducer repo. |
Hi @ondrejmirtes , here is a reproducer, using the actual file (changing only the namespace). This error shows only on |
@paulbalandan The type of the constant is |
Oh, that's annoying: https://github.com/JetBrains/phpstorm-stubs/blob/419389d409990c0e4cdd1f5f5c560f0a8ea333d1/memcached/memcached.php#L82 Notice all the constants with |
So, what's the actual type that you can check with |
I did a bit of tinkering, and it seems all
https://github.com/paulbalandan/phpstan-bug6263/runs/5032025575?check_suite_focus=true |
Can you please send PR to jetbrains/phpstorm-stubs that updates these to booleans? |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Bug report
Code snippet that reproduces the problem
Using PHPStan v1.3.0, it assumes that all memcached installations have SASL support.
https://phpstan.org/r/21ec5d0c-0f4e-499c-87ee-9b842a8ce5e6 (using the constant
Memcached::HAVE_SASL
)https://phpstan.org/r/ccb205ad-89bb-4af1-b3e9-2330603d3a8e (using the method check on
Memcached::setSaslAuthData
)Expected output
Previously on versions before 1.3.0, adding the constant name (
Memcached::HAVE_SASL
) on thedynamicConstantNames
parameter in phpstan.neon clears the error away. However, starting on 1.3.0, the error will becomeStrict comparison between 0 and false will always evaluate to false.
This only happens on machines with ext-memcached installed. On Windows, there's no error. Disabling the RuntimeReflectionProvider does not help either.For the method_exists error, this is my first time encountering this error in a bid to go away with the constant name but I suppose it also errors.
Did PHPStan help you today? Did it make you happy in any way?
The text was updated successfully, but these errors were encountered: