Skip to content

abstract class Enum is marked as@psalm-immutable which causes errors in PHPStan #171

Open
@Wirone

Description

@Wirone

We're currently introducing PHPStan's bleeding edge and I see that it started reporting errors like @readonly property cannot have a default value on classes that extend MyCLabs\Enum\Enum. It looks like @psalm-immutable annotation is normalised by PHPStan into readonly state, so cache and instances properties are considered as impure.

Is it possible to improve Enum's phpDocs so PHPStan won't report this errors?

Thanks @mabar for pointing it out on Slack 🍻

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