Skip to content

Misleading or unexpected error message about incomplete match when not trusting phpdoc #7622

@stof

Description

@stof

Bug report

When using a union of class constants as argument and not marking phpdoc types as certain, phpstan complains about the last matched case not being handled.

Code snippet that reproduces the problem

https://phpstan.org/r/7c5c6bcc-0753-475b-a612-46d8f012ae6f

Expected output

No error should be reported. Or if an error is reported due to not being certain, it should talk about other strings, not about the last case (that is handled)

Did PHPStan help you today? Did it make you happy in any way?

Helping a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions