data-fixtures
data-fixtures copied to clipboard
Allow to pass the class to getReference.
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)
- I can use the same name for different entities of different class.
- with some annotation psalm and phpstan can understand the class of the return value.