Skip to content

Types::ENUM is wrongly inferred in entityColumnRule #677

@VincentLanglet

Description

@VincentLanglet

The following code

    /**
     * @var self::LOGIN_METHOD_*
     */
    #[ORM\Column(name: 'login_method', type: Types::ENUM, options: ['default' => self::LOGIN_METHOD_BASIC_AUTH, 'values' => self::LOGIN_METHODS])]
    private string $loginMethod = self::LOGIN_METHOD_BASIC_AUTH;

now reports on level 8

Property App\Entity\User::$loginMethod type mapping mismatch: 
database can contain string but property expects 'BasicAuth'|'SAML'|'SSO'.

doctrine.columnType 

This is kinda a consequence of the PR #656 (cc @janedbal)

I assume something similar to https://github.com/phpstan/phpstan-doctrine/pull/656/files#diff-7fd356ee7494ac7e9610c9496e854e994cbcef6c4c56d533fc5fed88e4568a47R2030
should be done to the entityColumnRule.

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