Open tomtomklima opened 2 years ago
This bug report is missing a link to reproduction at phpstan.org/try.
It will most likely be closed after manual review.
If the annotation parser fails at parsing annotation, getting the metadata with the object manager will fail.
@ondrejmirtes solving this issue would be about changing the way phpstan-doctrine behaves when Doctrine reports an error during the loading of metadata (note that it has nothing to do with enums specifically, as the same could happen with another kind of invalid annotations)
Bug report
Run into PHPStan internal error when tried new feature of Doctrine - use native PHP enum as a entity database value (new in version 2.11 https://www.doctrine-project.org/2022/01/11/orm-2.11.html).
How to reproduce: in annotation for Doctrine entity use wrongly new construct
enumType=Status:class
- with only one column before class keyword.Code snippet that reproduces the problem
Do not have https://phpstan.org/try link, but here is the snippet (note single column instead of correct two):
Expected output
PHPStan should not throw internal error, but correctly catch invalid construct.