Bug report
The code snippet reports an error about missing return but there doesn't need to be one when yield is used. Doesn't matter that the yield is inside a condition.
Also if you check the "Strict rules" checkbox it seems that PHPStan outright crashed.
Code snippet that reproduces the problem
https://phpstan.org/r/c233a97e-89b9-4476-8c6f-6cf588b03ed0
Expected output
No error.
Bug report
The code snippet reports an error about missing return but there doesn't need to be one when yield is used. Doesn't matter that the yield is inside a condition.
Also if you check the "Strict rules" checkbox it seems that PHPStan outright crashed.
Code snippet that reproduces the problem
https://phpstan.org/r/c233a97e-89b9-4476-8c6f-6cf588b03ed0
Expected output
No error.