Skip to content

Releases: phpstan/phpstan-doctrine

0.11.2

11 Mar 11:53
Compare
Choose a tag to compare
  • 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

13 Feb 13:22
Compare
Choose a tag to compare

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 respects repositoryClass in entity class metadata.
  • Recognizes magic findBy*, findOneBy* and countBy* methods on EntityRepository.
  • Validates entity fields in repository findBy, findBy*, findOneBy, findOneBy*, count and countBy* 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

24 Jun 19:05
Compare
Choose a tag to compare

* Composer: replaced some requirements with conflicts - #29, thanks @lookyman!

0.9.1

04 Jan 14:46
Compare
Choose a tag to compare
  • Add dynamic return type extension for ObjectManager::merge() (c534c1d) - #16, thanks @stesie!
  • Add support getRepository call on ObjectManager interface (c1f3523) - #17, thanks @pauci!

0.9

29 Nov 13:44
Compare
Choose a tag to compare
0.9
  • Updated for PHPStan 0.9
  • Dynamic return type extension for EntityRepository methods via a generic type created by EntityManager::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

23 Jul 21:13
Compare
Choose a tag to compare
0.8

Requires PHPStan 0.8.

0.7

14 May 21:00
Compare
Choose a tag to compare
0.7

Requires PHPStan 0.7.

0.6.1

30 Jan 23:19
Compare
Choose a tag to compare
  • matching() returns the same type it was called on

0.6

30 Jan 22:51
Compare
Choose a tag to compare
0.6

Hello world!