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
Since psalm 3.17 a function with a continue statement and a switch with returns is reported as invalid.
3.17
continue
https://psalm.dev/r/b521fae60c
The text was updated successfully, but these errors were encountered:
I found these snippets:
<?php function a(): int { switch (random_int(1, 10)) { case 1: return 1; default: return 2; } } function b(): int { foreach([1,2] as $i) { continue; } switch (random_int(1, 10)) { case 1: return 1; default: return 2; } }
Psalm output (using commit 724b25b): ERROR: InvalidReturnType - 14:15 - Not all code paths of b end in a return statement, return type int expected
Sorry, something went wrong.
d8d17a6
Fix #4327 - make sure loop always returns
9e526d9
Fix vimeo#4327 - make sure loop always returns
84126fb
No branches or pull requests
Since psalm
3.17
a function with acontinue
statement and a switch with returns is reported as invalid.https://psalm.dev/r/b521fae60c
The text was updated successfully, but these errors were encountered: