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

Add generic typehint to RepositoryInterface and FactoryInterface #454

Merged
merged 1 commit into from
Jul 13, 2022
Merged

Add generic typehint to RepositoryInterface and FactoryInterface #454

merged 1 commit into from
Jul 13, 2022

Conversation

MrSrsen
Copy link
Contributor

@MrSrsen MrSrsen commented May 29, 2022

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Related tickets fixes #453
License MIT

@MrSrsen MrSrsen changed the title Add generic typehints to interfaces Add generic typehint to RepositoryInterface and FactoryInterface May 29, 2022
@MrSrsen MrSrsen marked this pull request as ready for review May 30, 2022 20:01
@MrSrsen MrSrsen requested a review from a team as a code owner May 30, 2022 20:01
Copy link
Member

@lchrusciel lchrusciel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to add templates to the implementation of these interfaces as well https://phpstan.org/blog/generics-by-examples#accept-a-class-string-and-return-the-object-of-that-type

@lchrusciel lchrusciel merged commit d453963 into Sylius:1.10 Jul 13, 2022
@lchrusciel
Copy link
Member

Hey Martin! Better static analysis is always a plus! Thanks for your proposal and PR! 🎉

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 this pull request may close these issues.

Add generic typehint to RepositoryInterface and FactoryInterface
3 participants