CrudControllerInterface: add missing EntityDto generics#6981
Merged
javiereguiluz merged 1 commit intoEasyCorp:4.xfrom Jun 11, 2025
Merged
CrudControllerInterface: add missing EntityDto generics#6981javiereguiluz merged 1 commit intoEasyCorp:4.xfrom
javiereguiluz merged 1 commit intoEasyCorp:4.xfrom
Conversation
Collaborator
|
Nice! Thanks a lot for providing PRs like this to improve generics. Love them! |
Contributor
|
I opened #6986 to reduce the negative impact of this generic. |
javiereguiluz
added a commit
that referenced
this pull request
Jun 17, 2025
…s (VincentLanglet) This PR was merged into the 4.x branch. Discussion ---------- Use a default template value for recently created Generics I tried the recent 4.24.8 branch and getting some errors I tried to fix. This - avoid error like reported in PR #6981 (comment) - avoid ~200 missing generic types in EasyAdminBundle code base So it should be simpler for user to start using those generics. It will still be possible later to improve the typing of existing interface like ``` interface EntityRepositoryInterface { public function createQueryBuilder(SearchDto $searchDto, EntityDto $entityDto, FieldCollection $fields, FilterCollection $filters): QueryBuilder; } ``` into ``` /** `@template` TEntity of object */ interface EntityRepositoryInterface { /** `@param` EntityDto<TEntity> $entityDto */ public function createQueryBuilder(SearchDto $searchDto, EntityDto $entityDto, FieldCollection $fields, FilterCollection $filters): QueryBuilder; } ``` when needed. Commits ------- 827cb3f Use default value for template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following #6969 this adds missing generic PHPDoc to
CrudControllerInterfacemethods that haveEntityDtoas an argument. Currently this results in PHPStan errors like