Skip to content

Consider adding a matchConditionsMatchingType rule? #286

@pkly

Description

@pkly

Hello,

I was looking through the rules and loved the switchConditionsMatchingType rule, as we just had a problem with exactly that, and I was wondering if it'd be possible to get a rule for matches too?

https://phpstan.org/r/3afb2b5f-392a-4fa4-8017-1eeb9ad95af0

Something like this would act as a reproducer, the only real issue is it would only work with simple matches, not something with complex expressions, but I feel like it could still be helpful.

I could also maybe work on it sometime, if you'd consider adding it to this repository.

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