Skip to content

"Enum Order is not backed" when value is not-int/string #13768

@mvorisek

Description

@mvorisek

Bug report

Although backed enum allows only int / string, PHPStan should warn for all types if the case value is assigned with any type. Currently there is no static analysis error.

Code snippet that reproduces the problem

https://phpstan.org/r/c628e80c-5511-4cfa-bded-7dbe9a7d216f

Expected output

PHPStan error for A - D case

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions