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
UnusedVariable
if
https://psalm.dev/r/a2c8c64a3e
The text was updated successfully, but these errors were encountered:
I found these snippets:
<?php abstract class Foo { abstract function validate(): bool|string; abstract function save(): bool|string; function bar(): void { if (true === ($result = $this->validate()) && true === ($result = $this->save())) { echo 'ok'; } elseif (is_string($result)) { echo $result; } else { echo 'error'; } } }
Psalm output (using commit ee778e9): INFO: UnusedVariable - 8:62 - $result is never referenced or the value is not used
Sorry, something went wrong.
Comparable false-negative InvalidReturn: https://psalm.dev/r/5858e7fc6e
InvalidReturn
<?php function bar(bool $result): bool { if ($result && ($result = rand(0, 1))) { return true; } return $result; }
Psalm output (using commit ee778e9): INFO: UnusedVariable - 4:21 - $result is never referenced or the value is not used
642f2f4
No branches or pull requests
https://psalm.dev/r/a2c8c64a3e
The text was updated successfully, but these errors were encountered: