Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to pass the class to getReference. #408

Closed
VincentLanglet opened this issue Oct 12, 2022 · 0 comments · Fixed by #409
Closed

Allow to pass the class to getReference. #408

VincentLanglet opened this issue Oct 12, 2022 · 0 comments · Fixed by #409

Comments

@VincentLanglet
Copy link
Contributor

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant