Skip to content

Enums and case grouping failing. #12722

@TheMarlboroMan

Description

@TheMarlboroMan

Bug report

When using enums to decide on method/function call results we get errors if case-fallthroughs (declaring consecutive cases so the same code is run for more than one) are used.

The snippet shows two methods, "intentional_fallthrough" and "no fallthrough" that are semantically equivalent but the fallthrough one is flagged as an error.

Code snippet that reproduces the problem

https://phpstan.org/r/570727d3-1e16-405c-8f0f-88743399e4e6

Expected output

We would expect the error if a case is missing, but not if all cases are taken into account.

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

It's very early today, but PHPStan did already help :).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions