phpstan-doctrine icon indicating copy to clipboard operation
phpstan-doctrine copied to clipboard

Add missing descriptors for `SmallFloatType` and `EnumType`

Open janedbal opened this issue 8 months ago • 3 comments

  • https://github.com/doctrine/dbal/pull/6536 (since dbal 4.2)
  • https://github.com/doctrine/dbal/pull/6471 (since dbal 4.1)
  • Resolves #619

janedbal avatar Apr 24 '25 13:04 janedbal

tests describing what this actually fixes would be nice

It is pretty painful to test new doctrine here (due to all the compatibility hacks). But added.

janedbal avatar Jun 13 '25 13:06 janedbal

Would it be possible to read the options ?

Yes, implemented.

janedbal avatar Jun 13 '25 13:06 janedbal

Would it be possible to read the options ?

Yes, implemented.

Great.

Could add a test for the EntityColumnRule too https://github.com/phpstan/phpstan-doctrine/blob/a1a9efb64708580a9d8b0d150340f7777d2b8aa0/tests/Rules/Doctrine/ORM/EntityColumnRuleTest.php#L35

(I assume we just need to add an enum field in the BrokenEntity https://github.com/phpstan/phpstan-doctrine/blob/a1a9efb64708580a9d8b0d150340f7777d2b8aa0/tests/Rules/Doctrine/ORM/data/MyBrokenEntity.php)

I assume that

/**
   * @Column(type="enum", options={"values"={"a", "b", "c"}})
   * @var 'a'|'b'|'c'
   *
   public $enum;

shouldn't be reported but

/**
   * @Column(type="enum", options={"values"={"a", "b", "c"}})
   * @var string
   *
   public $enumWithUnprecisedPHPDoc;

should be reported

VincentLanglet avatar Jun 13 '25 14:06 VincentLanglet

Thank you.

ondrejmirtes avatar Jul 17 '25 11:07 ondrejmirtes