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

Fix compatibility with SonataAdmin and add final #1438

Merged
merged 6 commits into from
May 5, 2021

Conversation

VincentLanglet
Copy link
Member

@VincentLanglet VincentLanglet commented May 3, 2021

Changelog

### Changed
- Add final to abstract classes method.

@@ -47,8 +47,8 @@ public function countResults(): int
public function init(): void
{
$query = $this->getQuery();
if (null === $query) {
throw new \LogicException('The pager need a query to be initialised');
if (!$query instanceof ProxyQueryInterface) {
Copy link
Member Author

Choose a reason for hiding this comment

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

This was changed recently.
But we still need the execute method to return a countable value.

@@ -98,14 +98,7 @@ public function filter(ProxyQueryInterface $query, string $alias, string $field,
$query->getQueryBuilder()->setParameter($parameterName, $value, $this->getParameterType($value));
}

public function getDefaultOptions(): array
Copy link
Member Author

Choose a reason for hiding this comment

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

This method is always overriden.

public function getRenderSettings(): array
{
return [DefaultType::class, [
'operator_type' => $this->getOption('operator_type'),
'operator_options' => $this->getOption('operator_options'),
'field_type' => $this->getFieldType(),
'field_options' => $this->getFieldOptions(),
'field_options' => [
Copy link
Member Author

Choose a reason for hiding this comment

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

I didn't kept the choices option.

I think it's not used. It's supposed to be used this way

'choices' => [
    'choices' => [...],
],

The syntax is so weird I assume it wasn't used this way.
But I wonder if I shouldn't add choice_translation_domain => false in the default values.

@VincentLanglet VincentLanglet requested a review from a team May 3, 2021 23:43
@VincentLanglet VincentLanglet added this to the 4.0 milestone May 4, 2021
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