mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
The class ClassMetada is not correctly inferring the constructor of ClassMetadaInfo #6730
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @VincentLanglet on GitHub (May 23, 2021).
Hi
Currently
new ClassMetadataInfo(\DateTime::class)is inferred asClassMetadataInfo<\DateTime>by both psalm and phpstannew ClassMetadata(\DateTime::class)is inferred asClassMetadata<\DateTime>by psalm but asClassMetadata<object>by phpstanThis is related to this phpstan issue https://github.com/phpstan/phpstan/issues/5057
I don't know how and when the issue will be fixed so one way to fix it temporary would be to repeat the constructor:
Since you're using phpstan in this project, you might end with this issue while bumping the phpstan level.
Do you prefer I create a PR here or in https://github.com/phpstan/phpstan-doctrine ?
(The second solution won't fix the issue here since you're not using the library here)
@VincentLanglet commented on GitHub (May 24, 2021):
I saw you did a lot of static analysis on this repository @greg0ire, maybe you can tell me (or ping the right person) to decide if I should do a PR here or in phpstan repository ? :)
@greg0ire commented on GitHub (May 24, 2021):
🤔 isn't that going to be fixed by https://github.com/doctrine/orm/pull/8708 ?
@VincentLanglet commented on GitHub (May 24, 2021):
Sorry, my first post wasn't clear because I played with my vendor.
Currently
After https://github.com/doctrine/orm/pull/8708
@greg0ire commented on GitHub (May 24, 2021):
I see. I think it should be fixed here, with the repetition you suggested. In order for that constructor not to get removed, please also add something similar to what Marco did in https://github.com/doctrine/dbal/pull/4638
It was already suggested here BTW: https://github.com/doctrine/orm/pull/8633#issuecomment-841678603
@VincentLanglet commented on GitHub (May 31, 2021):
Solved in https://github.com/doctrine/orm/pull/8734