doctrine / data-fixtures

Doctrine2 ORM Data Fixtures Extensions
http://www.doctrine-project.org
MIT License
2.76k stars 224 forks source link

Allow to pass the class to getReference. #408

Closed VincentLanglet closed 1 year ago

VincentLanglet commented 1 year ago

When doing something like

$user->setContext($this->getReference(ContextFixtures::FR));

currently phpstan is reporting an error before getReference is typehinted as an object, and not a Context class.

Also, if I have a country FR and a context FR, I cannot use the same name/reference for both of those entities.

Both of this issues could be solved if we were using the method this way

$this->getReference(ContextFixtures::FR, Context::class)