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
PHPStan reports a false positive when inline yield is used:
<?php function foo(): Generator { while ($bar = yield 'foo') { } }
Function foo() should return Generator but return statement is missing.
https://phpstan.org/r/ec37ffcb-25f5-424a-b21c-2f5ec10703dd
The text was updated successfully, but these errors were encountered:
This one is really easy to fix. We have to also take into account $condResult->hasYield() here https://github.com/phpstan/phpstan-src/blob/a23f80828620e663c67bbacdcb246b888db158a4/src/Analyser/NodeScopeResolver.php#L809, not just $finalScopeResult->hasYield() at https://github.com/phpstan/phpstan-src/blob/a23f80828620e663c67bbacdcb246b888db158a4/src/Analyser/NodeScopeResolver.php#L870.
The best way to test this is to add another test to Functions ReturnTypeRuleTest.
Sorry, something went wrong.
phpstan/phpstan-src@3c43c54
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
PHPStan reports a false positive when inline yield is used:
https://phpstan.org/r/ec37ffcb-25f5-424a-b21c-2f5ec10703dd
The text was updated successfully, but these errors were encountered: