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
https://psalm.dev/r/d21bfc97cf
The text was updated successfully, but these errors were encountered:
I found these snippets:
<?php function getPath(string $path): string { return $path; } /** @return resource|null */ function foo() { if (is_readable($path = getPath('/path/1')) || is_readable($path = getPath('/path/2'))) { return fopen($path, 'r'); } return null; }
Psalm output (using commit 517b203): INFO: UnusedVariable - 9:64 - $path is never referenced or the value is not used
Sorry, something went wrong.
This also manifests as a false-negative type error: https://psalm.dev/r/332f48c9cc
<?php function getPath(): string|object { return rand(0, 1) ? "a" : new stdClass(); } function foo(string $s) : string { if (($path = $s) || ($path = getPath())) { return $path; } return "b"; }
Psalm output (using commit 517b203): INFO: UnusedVariable - 8:26 - $path is never referenced or the value is not used
7080bc3
No branches or pull requests
https://psalm.dev/r/d21bfc97cf
The text was updated successfully, but these errors were encountered: