Skip to content

Array of enums not supportedΒ #320

@ThomasLandauer

Description

@ThomasLandauer

doctrine/orm 2.12.0 now supports arrays of enums, see doctrine/orm#9497

This is the syntax:

#[ORM\Column(type: Types::SIMPLE_ARRAY, length: 255, nullable: true, enumType: Foo::class)]
private array $foo = [];

phpstan is reporting:

Property App\Entity\User::$foo type mapping mismatch: backing type string of enum App\Enum\Foo does not match database type array.
Property App\Entity\User::$foo type mapping mismatch: database can contain App\Enum\Foo|null but property expects array.
Property App\Entity\User::$foo type mapping mismatch: property can contain array but database expects App\Enum\Foo|null.

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