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 information for child admins #6882

Merged
merged 1 commit into from
Feb 21, 2021

Conversation

core23
Copy link
Member

@core23 core23 commented Feb 20, 2021

Subject

There are some method signatures that does not specify the generic type of the AdminInterface. Some types are wrong.

From the API perspective, you can not determine the type of the child admin. It could be of any type.

I am targeting this branch, because this is BC.

Changelog

### Added
- Add generic information for child admins

@@ -75,7 +75,7 @@ public function configureRoutes(AdminInterface $admin, RouteCollection $collecti
* @return void
*
* @phpstan-param AdminInterface<T> $admin
* @phpstan-param AdminInterface<T>|null $childAdmin
* @phpstan-param AdminInterface<object>|null $childAdmin
Copy link
Member Author

Choose a reason for hiding this comment

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

The admin and child admin can mange different types, so object is more accurate here.

@core23 core23 requested a review from a team February 20, 2021 16:19
@VincentLanglet VincentLanglet requested a review from a team February 20, 2021 20:14
@franmomu franmomu merged commit 2367690 into sonata-project:3.x Feb 21, 2021
@franmomu
Copy link
Member

thanks @core23! (now I can remove all those ignored errors 😬 )

@core23 core23 deleted the generics branch February 21, 2021 07:21
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.

3 participants