We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
/** * @param callable(bool &$save): void $call */ function get(callable $call) { $save = true; $call($save); if ($save) { echo "Save item\n"; } else { echo "Don't save\n"; } } get(function (bool &$save) {}); // Save item get(function (bool &$save) { $save = false; }); // Don't save
https://phpstan.org/r/528c3596-7697-4fe6-810d-3ce01231328c
If condition is always true.
This error is a false positive, since the callable takes the bool by reference and might, thus, modify it
bool
It's been very helpful, found a bunch of real bugs and improvements :)
The text was updated successfully, but these errors were encountered:
Thank you for your kind words! :)
Fixed: phpstan/phpstan-src@109bf99
Sorry, something went wrong.
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.
No branches or pull requests
Bug report
Code snippet that reproduces the problem
https://phpstan.org/r/528c3596-7697-4fe6-810d-3ce01231328c
Expected output
This error is a false positive, since the callable takes the
bool
by reference and might, thus, modify itDid PHPStan help you today? Did it make you happy in any way?
It's been very helpful, found a bunch of real bugs and improvements :)
The text was updated successfully, but these errors were encountered: