Releases: phpstan/phpstan-doctrine
Releases · phpstan/phpstan-doctrine
0.11.2
- Fixed false positive with an unknown field name: clashing of a repository's implemented method with the same name pattern as magic methods have (#56), #52, thanks @roverwolf!
- Fixed return type of a repository's implemented method with the same name pattern as magic methods have (f7ce984), #57
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.
0.10
0.9.1
0.9
- Updated for PHPStan 0.9
- Dynamic return type extension for
EntityRepository
methods via a generic type created byEntityManager::getRepository()
(5fa20b8) - EntityManager methods should rather return mixed than the documented
object
typehint (a8fd4a5) - Support ObjectManager interface (84dd833) - #15, thanks @JanTvrdik!
- Add tests for existing extensions - #12, thanks @vhenzl!
0.8
Requires PHPStan 0.8.
0.7
Requires PHPStan 0.7.
0.6.1
matching()
returns the same type it was called on
0.6
Hello world!