nextras / orm-phpstan

PHPStan extension for Nextras Orm
https://nextras.org/orm
MIT License
11 stars 6 forks source link

Failing test for Model::getRepositoryForEntity #14

Closed adaamz closed 4 years ago

adaamz commented 4 years ago

Would be nice to have dynamic return type extension for this method. Or we can remove support for object resolution and add generics :)

hrach commented 4 years ago

Or we can remove support for object resolution and add generics :)

AFAIK this cannot be solved with generics.

hrach commented 4 years ago

The second could provide IRepository<Author>. Though not AuthorsRepository.

adaamz commented 4 years ago

Right, I'm using generics where I'm lazy to write extension 😄 probably not good idea.

Do you thing some of these can be solved via return extension? I have something work in progress so I can add it there, it is failing test or failing test with some implementation difference :)