Skip to content

Match expression does not handle remaining value: class-string #7698

@Dgame

Description

@Dgame

Bug report

PHPStan does not recognise that all match arms are handled when you use a class union type.

Code snippet that reproduces the problem

https://phpstan.org/r/51d5cd6f-2479-4db6-ae2b-cfae97da918d

Expected output

Since all match arms are covered, no error should happen.

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

Every day!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions