🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

False positive with conditional yield #5681

Description

@enumag

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions