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

Move template param of the ModelManager to the class #7066

Merged

Conversation

VincentLanglet
Copy link
Member

Subject

I am targeting this branch, because BC.

@franmomu You proposed this change #6721, and I didn't fully understand if it was a good change or not. Now I think I agree with your proposal.

If the modelManager is generic, ModelManager<object> or ModelManager<T> could be used.
If the modelManager works only for some objects, like https://github.com/sonata-project/SonataAdminBundle/blob/3.x/tests/App/Model/ModelManager.php#L22, it could be ModelManager<Foo>.

It could fixed https://github.com/sonata-project/SonataAdminBundle/blob/master/tests/App/Model/ModelManager.php#L56-L60

See https://phpstan.org/r/ab8c0e82-a65c-4b98-9662-18e07a73ce07 Vs https://phpstan.org/r/adc525ad-dadf-4912-af8e-7087ac6b1344

Changelog

### Added
- Added generic for ModelManager class

@VincentLanglet VincentLanglet marked this pull request as draft April 14, 2021 22:45
@VincentLanglet VincentLanglet force-pushed the modelManagerTemplate branch 5 times, most recently from 30bc9f9 to 5636913 Compare April 14, 2021 23:11
@VincentLanglet VincentLanglet marked this pull request as ready for review April 14, 2021 23:14
@VincentLanglet VincentLanglet requested a review from a team April 14, 2021 23:14
@phansys phansys requested review from franmomu and a team April 14, 2021 23:16
@phansys phansys added the minor label Apr 14, 2021
@jordisala1991 jordisala1991 merged commit b518bd2 into sonata-project:3.x Apr 15, 2021
@jordisala1991
Copy link
Member

Thank you @VincentLanglet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants