0.11.1
PHPStan's Doctrine extension just got a lot better! To take advantage of the latest features, check out the README.
TL; DR: Include rules.neon
in your phpstan.neon
and provide a file that loads EntityManager instance from your application. Put the file path to doctrine.objectManagerLoader
config key.
Thanks to @lcobucci and @mcfedr for their awesome work!
What's new
- Static DQL validation! PHPStan can now validate syntax and even referenced fields and associations of your DQL queries. (❗️❗️❗️)
EntityManager::getRepository()
return type now respectsrepositoryClass
in entity class metadata.- Recognizes magic
findBy*
,findOneBy*
andcountBy*
methods on EntityRepository. - Validates entity fields in repository
findBy
,findBy*
,findOneBy
,findOneBy*
,count
andcountBy*
method call arguments. - Interprets generic-like syntax
EntityRepository<MyEntity>
in phpDocs for further type inference of methods called on the repository. - Support for Doctrine ODM.