Skip to content

False-positive of smallint type #672

Description

@SerafimArts

The following code:

    /**
     * @var int<-32768, 32767>
     */
    #[ORM\Column(name: 'sorting_order', type: 'smallint', options: ['default' => 0])]
    public int $order = 0;

Reports:

Property Entity::$order type mapping mismatch: database can contain int but property expects int<-32768, 32767>.
         🪪 doctrine.columnType

But expected:

OK

MySQL: https://dev.mysql.com/doc/refman/8.4/en/integer-types.html

smallint is int<-32768, 32767>

PostgreSQL: https://www.postgresql.org/docs/current/datatype-numeric.html

smallint is int<-32768, 32767>

Doctrine: https://www.doctrine-project.org/projects/doctrine-dbal/en/4.2/reference/types.html#smallint

smallint is int<-32768, 32767>

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