Skip to content

Enum and match conditions #8486

@ondrejmirtes

Description

@ondrejmirtes

Discussed in #8484

Originally posted by nyamsprod December 8, 2022
I have an Enum and a match condition. I tried to help PHPStan resolving the possible return type but it fails with using the result on the explode function. PHPStan seems to not take into account the result of the match process.

https://phpstan.org/r/c6c22699-a92c-422d-b0c0-ddca1e0a5227

I would expect Operator::character to only return 'foo'|'bar'|'baz' not ''|'foo'|'bar'|'baz'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions