Skip to content

Commit

Permalink
Cleanup dead setDefaultOptions(..) methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dmaicher committed Aug 27, 2020
1 parent 51deb2d commit f30e4b2
Show file tree
Hide file tree
Showing 20 changed files with 0 additions and 401 deletions.
114 changes: 0 additions & 114 deletions .phpstan/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -223,120 +223,6 @@ parameters:
count: 1
path: ../src/Block/AdminStatsBlockService.php

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\#1 \\$resolver of method .+(Type|Extension)\\:\\:configureOptions\\(\\) expects Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolver, Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface given\\.$#"
count: 17
path: ../src/Form/*

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\$resolver of method Sonata\\\\AdminBundle\\\\Form\\\\Extension\\\\Field\\\\Type\\\\FormTypeFieldExtension\\:\\:setDefaultOptions\\(\\) has invalid typehint type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: ../src/Form/Extension/Field/Type/FormTypeFieldExtension.php

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\$resolver of method Sonata\\\\AdminBundle\\\\Form\\\\Extension\\\\Field\\\\Type\\\\MopaCompatibilityTypeFieldExtension\\:\\:setDefaultOptions\\(\\) has invalid typehint type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: ../src/Form/Extension/Field/Type/MopaCompatibilityTypeFieldExtension.php

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\$resolver of method Sonata\\\\AdminBundle\\\\Form\\\\Type\\\\AclMatrixType\\:\\:setDefaultOptions\\(\\) has invalid typehint type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: ../src/Form/Type/AclMatrixType.php

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\$resolver of method Sonata\\\\AdminBundle\\\\Form\\\\Type\\\\AdminType\\:\\:setDefaultOptions\\(\\) has invalid typehint type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: ../src/Form/Type/AdminType.php

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\$resolver of method Sonata\\\\AdminBundle\\\\Form\\\\Type\\\\ChoiceFieldMaskType\\:\\:setDefaultOptions\\(\\) has invalid typehint type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: ../src/Form/Type/ChoiceFieldMaskType.php

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\$resolver of method Sonata\\\\AdminBundle\\\\Form\\\\Type\\\\Filter\\\\ChoiceType\\:\\:setDefaultOptions\\(\\) has invalid typehint type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: ../src/Form/Type/Filter/ChoiceType.php

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\$resolver of method Sonata\\\\AdminBundle\\\\Form\\\\Type\\\\Filter\\\\DateRangeType\\:\\:setDefaultOptions\\(\\) has invalid typehint type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: ../src/Form/Type/Filter/DateRangeType.php

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\$resolver of method Sonata\\\\AdminBundle\\\\Form\\\\Type\\\\Filter\\\\DateTimeRangeType\\:\\:setDefaultOptions\\(\\) has invalid typehint type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: ../src/Form/Type/Filter/DateTimeRangeType.php

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\$resolver of method Sonata\\\\AdminBundle\\\\Form\\\\Type\\\\Filter\\\\DateTimeType\\:\\:setDefaultOptions\\(\\) has invalid typehint type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: ../src/Form/Type/Filter/DateTimeType.php

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\$resolver of method Sonata\\\\AdminBundle\\\\Form\\\\Type\\\\Filter\\\\DateType\\:\\:setDefaultOptions\\(\\) has invalid typehint type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: ../src/Form/Type/Filter/DateType.php

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\$resolver of method Sonata\\\\AdminBundle\\\\Form\\\\Type\\\\Filter\\\\DefaultType\\:\\:setDefaultOptions\\(\\) has invalid typehint type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: ../src/Form/Type/Filter/DefaultType.php

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\$resolver of method Sonata\\\\AdminBundle\\\\Form\\\\Type\\\\Filter\\\\NumberType\\:\\:setDefaultOptions\\(\\) has invalid typehint type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: ../src/Form/Type/Filter/NumberType.php

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\$resolver of method Sonata\\\\AdminBundle\\\\Form\\\\Type\\\\ModelAutocompleteType\\:\\:setDefaultOptions\\(\\) has invalid typehint type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: ../src/Form/Type/ModelAutocompleteType.php

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\$resolver of method Sonata\\\\AdminBundle\\\\Form\\\\Type\\\\ModelHiddenType\\:\\:setDefaultOptions\\(\\) has invalid typehint type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: ../src/Form/Type/ModelHiddenType.php

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\$resolver of method Sonata\\\\AdminBundle\\\\Form\\\\Type\\\\ModelListType\\:\\:setDefaultOptions\\(\\) has invalid typehint type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: ../src/Form/Type/ModelListType.php

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\$resolver of method Sonata\\\\AdminBundle\\\\Form\\\\Type\\\\ModelReferenceType\\:\\:setDefaultOptions\\(\\) has invalid typehint type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: ../src/Form/Type/ModelReferenceType.php

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\$resolver of method Sonata\\\\AdminBundle\\\\Form\\\\Type\\\\ModelType\\:\\:setDefaultOptions\\(\\) has invalid typehint type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: ../src/Form/Type/ModelType.php

-
# will be fixed in v4. Currently BC break
message: "#^Parameter \\$resolver of method Sonata\\\\AdminBundle\\\\Form\\\\Extension\\\\ChoiceTypeExtension\\:\\:setDefaultOptions\\(\\) has invalid typehint type Symfony\\\\Component\\\\OptionsResolver\\\\OptionsResolverInterface\\.$#"
count: 1
path: ../src/Form/Extension/ChoiceTypeExtension.php

-
# will be fixed in v4. The file won't exist
message: "#^Call to static method load\\(\\) on an unknown class Symfony\\\\Component\\\\ClassLoader\\\\ClassCollectionLoader\\.$#"
Expand Down
91 changes: 0 additions & 91 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,97 +57,6 @@
</UndefinedClass>
<UnrecognizedStatement occurrences="1"/>
</file>
<!--will be removed in v4. Currently BC break-->
<file src="src/Form/Extension/ChoiceTypeExtension.php">
<UndefinedClass occurrences="1">
<code>OptionsResolverInterface</code>
</UndefinedClass>
</file>
<file src="src/Form/Extension/Field/Type/FormTypeFieldExtension.php">
<UndefinedClass occurrences="1">
<code>OptionsResolverInterface</code>
</UndefinedClass>
</file>
<file src="src/Form/Extension/Field/Type/MopaCompatibilityTypeFieldExtension.php">
<UndefinedClass occurrences="1">
<code>OptionsResolverInterface</code>
</UndefinedClass>
</file>
<file src="src/Form/Type/AclMatrixType.php">
<UndefinedClass occurrences="1">
<code>OptionsResolverInterface</code>
</UndefinedClass>
</file>
<file src="src/Form/Type/AdminType.php">
<UndefinedClass occurrences="1">
<code>OptionsResolverInterface</code>
</UndefinedClass>
</file>
<file src="src/Form/Type/ChoiceFieldMaskType.php">
<UndefinedClass occurrences="1">
<code>OptionsResolverInterface</code>
</UndefinedClass>
</file>
<file src="src/Form/Type/Filter/ChoiceType.php">
<UndefinedClass occurrences="1">
<code>OptionsResolverInterface</code>
</UndefinedClass>
</file>
<file src="src/Form/Type/Filter/DateRangeType.php">
<UndefinedClass occurrences="1">
<code>OptionsResolverInterface</code>
</UndefinedClass>
</file>
<file src="src/Form/Type/Filter/DateTimeRangeType.php">
<UndefinedClass occurrences="1">
<code>OptionsResolverInterface</code>
</UndefinedClass>
</file>
<file src="src/Form/Type/Filter/DateTimeType.php">
<UndefinedClass occurrences="1">
<code>OptionsResolverInterface</code>
</UndefinedClass>
</file>
<file src="src/Form/Type/Filter/DateType.php">
<UndefinedClass occurrences="1">
<code>OptionsResolverInterface</code>
</UndefinedClass>
</file>
<file src="src/Form/Type/Filter/DefaultType.php">
<UndefinedClass occurrences="1">
<code>OptionsResolverInterface</code>
</UndefinedClass>
</file>
<file src="src/Form/Type/Filter/NumberType.php">
<UndefinedClass occurrences="1">
<code>OptionsResolverInterface</code>
</UndefinedClass>
</file>
<file src="src/Form/Type/ModelAutocompleteType.php">
<UndefinedClass occurrences="1">
<code>OptionsResolverInterface</code>
</UndefinedClass>
</file>
<file src="src/Form/Type/ModelHiddenType.php">
<UndefinedClass occurrences="1">
<code>OptionsResolverInterface</code>
</UndefinedClass>
</file>
<file src="src/Form/Type/ModelListType.php">
<UndefinedClass occurrences="1">
<code>OptionsResolverInterface</code>
</UndefinedClass>
</file>
<file src="src/Form/Type/ModelReferenceType.php">
<UndefinedClass occurrences="1">
<code>OptionsResolverInterface</code>
</UndefinedClass>
</file>
<file src="src/Form/Type/ModelType.php">
<UndefinedClass occurrences="1">
<code>OptionsResolverInterface</code>
</UndefinedClass>
</file>
<!-- ignore template files-->
<file src="src/Resources/skeleton/Admin.tpl.php">
<UndefinedGlobalVariable occurrences="6">
Expand Down
11 changes: 0 additions & 11 deletions src/Form/Extension/ChoiceTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

/**
* @final since sonata-project/admin-bundle 3.52
Expand All @@ -27,16 +26,6 @@
*/
class ChoiceTypeExtension extends AbstractTypeExtension
{
/**
* NEXT_MAJOR: Remove method, when bumping requirements to SF 2.7+.
*
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$this->configureOptions($resolver);
}

public function configureOptions(OptionsResolver $resolver)
{
$optionalOptions = ['sortable'];
Expand Down
11 changes: 0 additions & 11 deletions src/Form/Extension/Field/Type/FormTypeFieldExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

/**
* @final since sonata-project/admin-bundle 3.52
Expand Down Expand Up @@ -168,16 +167,6 @@ public static function getExtendedTypes()
return [FormType::class];
}

/**
* NEXT_MAJOR: Remove method, when bumping requirements to SF 2.7+.
*
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$this->configureOptions($resolver);
}

public function configureOptions(OptionsResolver $resolver)
{
$resolver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

/**
* This class is built to allow AdminInterface to work properly
Expand All @@ -30,16 +29,6 @@
*/
class MopaCompatibilityTypeFieldExtension extends AbstractTypeExtension
{
/**
* NEXT_MAJOR: Remove method, when bumping requirements to SF 2.7+.
*
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$this->configureOptions($resolver);
}

public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
Expand Down
11 changes: 0 additions & 11 deletions src/Form/Type/AclMatrixType.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Security\Core\User\UserInterface;

/**
Expand All @@ -45,16 +44,6 @@ public function buildForm(FormBuilderInterface $builder, array $options)
}
}

/**
* NEXT_MAJOR: Remove method, when bumping requirements to SF 2.7+.
*
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$this->configureOptions($resolver);
}

public function configureOptions(OptionsResolver $resolver)
{
$resolver->setRequired(['permissions', 'acl_value']);
Expand Down
11 changes: 0 additions & 11 deletions src/Form/Type/AdminType.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\Options;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\PropertyAccess\Exception\NoSuchIndexException;
use Symfony\Component\PropertyAccess\PropertyAccessor;

Expand Down Expand Up @@ -131,16 +130,6 @@ public function buildView(FormView $view, FormInterface $form, array $options)
$view->vars['btn_catalogue'] = $options['btn_catalogue'];
}

/**
* NEXT_MAJOR: Remove method, when bumping requirements to SF 2.7+.
*
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$this->configureOptions($resolver);
}

public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
Expand Down
11 changes: 0 additions & 11 deletions src/Form/Type/ChoiceFieldMaskType.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

/**
* @final since sonata-project/admin-bundle 3.52
Expand Down Expand Up @@ -49,16 +48,6 @@ public function buildView(FormView $view, FormInterface $form, array $options)
parent::buildView($view, $form, $options);
}

/**
* NEXT_MAJOR: Remove method, when bumping requirements to SF 2.7+.
*
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$this->configureOptions($resolver);
}

public function configureOptions(OptionsResolver $resolver)
{
parent::configureOptions($resolver);
Expand Down
11 changes: 0 additions & 11 deletions src/Form/Type/Filter/ChoiceType.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
use Symfony\Component\Form\Extension\Core\Type\ChoiceType as FormChoiceType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Translation\TranslatorInterface;

/**
Expand Down Expand Up @@ -80,16 +79,6 @@ public function buildForm(FormBuilderInterface $builder, array $options)
;
}

/**
* NEXT_MAJOR: Remove method, when bumping requirements to SF 2.7+.
*
* {@inheritdoc}
*/
public function setDefaultOptions(OptionsResolverInterface $resolver)
{
$this->configureOptions($resolver);
}

public function configureOptions(OptionsResolver $resolver)
{
$resolver->setDefaults([
Expand Down
Loading

0 comments on commit f30e4b2

Please sign in to comment.