-
-
Notifications
You must be signed in to change notification settings - Fork 344
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
Update code with ProxyQueryInterface generic #1687
Update code with ProxyQueryInterface generic #1687
Conversation
dc9cab6
to
726c277
Compare
726c277
to
472545f
Compare
@@ -156,14 +156,15 @@ public function getBaseDatagrid(AdminInterface $admin, array $values = []): Data | |||
if (!$query instanceof ProxyQueryInterface) { | |||
throw new \TypeError(sprintf('The admin query MUST implement %s.', ProxyQueryInterface::class)); | |||
} | |||
/** @phpstan-var ProxyQueryInterface<object> $query */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this one necessary? Isnt the admin->createQuery returning already with the generic applied?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's considered as a
Sonata\AdminBundle\Datagrid\ProxyQueryInterface&Sonata\DoctrineORMAdminBundle\Datagrid\ProxyQueryInterface<object>
And I have the error:
Method Sonata\DoctrineORMAdminBundle\Builder\DatagridBuilder::getBaseDatagrid() should return
Sonata\AdminBundle\Datagrid\DatagridInterface<Sonata\DoctrineORMAdminBundle\Datagrid\ProxyQueryInterface<object>> but returns
Sonata\AdminBundle\Datagrid\Datagrid<Sonata\DoctrineORMAdminBundle\Datagrid\ProxyQueryInterface>.
/** | ||
* @param ProxyQueryInterface<object> $query | ||
*/ | ||
private function handleModel(ProxyQueryInterface $query, string $alias, FilterData $data): void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isnt this change a bc break?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The class is final.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we need similar change for mongodb
Subject
I am targeting this branch, because {reason}.
Closes #{put_issue_number_here}.
Changelog