diff --git a/src/Form/Extension/BaseChoiceTypeExtension.php b/src/Form/Extension/BaseChoiceTypeExtension.php new file mode 100644 index 0000000000..a3ded31141 --- /dev/null +++ b/src/Form/Extension/BaseChoiceTypeExtension.php @@ -0,0 +1,45 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Sonata\AdminBundle\Form\Extension; + +use Symfony\Component\Form\AbstractTypeExtension; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\FormView; +use Symfony\Component\OptionsResolver\OptionsResolver; + +/** + * NEXT_MAJOR: Copy its methods to ChoiceTypeExtension and remove it. + * + * @internal + */ +abstract class BaseChoiceTypeExtension extends AbstractTypeExtension +{ + public function configureOptions(OptionsResolver $resolver) + { + $optionalOptions = ['sortable']; + + $resolver->setDefined($optionalOptions); + } + + public function buildView(FormView $view, FormInterface $form, array $options) + { + $view->vars['sortable'] = \array_key_exists('sortable', $options) && $options['sortable']; + } + + public function getExtendedType() + { + return ChoiceType::class; + } +} diff --git a/src/Form/Extension/ChoiceTypeExtension.php b/src/Form/Extension/ChoiceTypeExtension.php index 5e729f1056..e8cea9b85c 100644 --- a/src/Form/Extension/ChoiceTypeExtension.php +++ b/src/Form/Extension/ChoiceTypeExtension.php @@ -13,38 +13,36 @@ namespace Sonata\AdminBundle\Form\Extension; -use Symfony\Component\Form\AbstractTypeExtension; use Symfony\Component\Form\Extension\Core\Type\ChoiceType; -use Symfony\Component\Form\FormInterface; -use Symfony\Component\Form\FormView; -use Symfony\Component\OptionsResolver\OptionsResolver; -/** - * @final since sonata-project/admin-bundle 3.52 - * - * @author Amine Zaghdoudi - */ -class ChoiceTypeExtension extends AbstractTypeExtension -{ - public function configureOptions(OptionsResolver $resolver) - { - $optionalOptions = ['sortable']; - - $resolver->setDefined($optionalOptions); - } - - public function buildView(FormView $view, FormInterface $form, array $options) +use Symfony\Component\Form\FormTypeExtensionInterface; + +// NEXT_MAJOR: Remove the "else" part, copy all methods from BaseChoiceTypeExtension in this class and +// extend from AbstractTypeExtension. +if (method_exists(FormTypeExtensionInterface::class, 'getExtendedTypes')) { + /** + * @final since sonata-project/admin-bundle 3.52 + * + * @author Amine Zaghdoudi + */ + class ChoiceTypeExtension extends BaseChoiceTypeExtension { - $view->vars['sortable'] = \array_key_exists('sortable', $options) && $options['sortable']; + public static function getExtendedTypes(): iterable + { + return [ChoiceType::class]; + } } - - public function getExtendedType() - { - return ChoiceType::class; - } - - public static function getExtendedTypes(): iterable +} else { + /** + * @final since sonata-project/admin-bundle 3.52 + * + * @author Amine Zaghdoudi + */ + class ChoiceTypeExtension extends BaseChoiceTypeExtension { - return [ChoiceType::class]; + public static function getExtendedTypes() + { + return [ChoiceType::class]; + } } } diff --git a/src/Form/Extension/Field/Type/BaseFormTypeFieldExtension.php b/src/Form/Extension/Field/Type/BaseFormTypeFieldExtension.php new file mode 100644 index 0000000000..94529d8316 --- /dev/null +++ b/src/Form/Extension/Field/Type/BaseFormTypeFieldExtension.php @@ -0,0 +1,239 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Sonata\AdminBundle\Form\Extension\Field\Type; + +use Sonata\AdminBundle\Admin\FieldDescriptionInterface; +use Sonata\AdminBundle\Exception\NoValueException; +use Symfony\Component\Form\AbstractTypeExtension; +use Symfony\Component\Form\Extension\Core\Type\FormType; +use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\FormView; +use Symfony\Component\OptionsResolver\OptionsResolver; + +/** + * NEXT_MAJOR: Copy its methods to FormTypeFieldExtension and remove it. + * + * @internal + */ +abstract class BaseFormTypeFieldExtension extends AbstractTypeExtension +{ + /** + * @var array + */ + protected $defaultClasses = []; + + /** + * @var array + */ + protected $options = []; + + public function __construct(array $defaultClasses, array $options) + { + $this->defaultClasses = $defaultClasses; + $this->options = $options; + } + + public function buildForm(FormBuilderInterface $builder, array $options) + { + $sonataAdmin = [ + 'name' => null, + 'admin' => null, + 'value' => null, + 'edit' => 'standard', + 'inline' => 'natural', + 'field_description' => null, + 'block_name' => false, + 'options' => $this->options, + ]; + + $builder->setAttribute('sonata_admin_enabled', false); + // NEXT_MAJOR: Remove this line + $builder->setAttribute('sonata_help', false); + + if ($options['sonata_field_description'] instanceof FieldDescriptionInterface) { + $fieldDescription = $options['sonata_field_description']; + + $sonataAdmin['admin'] = $fieldDescription->getAdmin(); + $sonataAdmin['field_description'] = $fieldDescription; + $sonataAdmin['name'] = $fieldDescription->getName(); + $sonataAdmin['edit'] = $fieldDescription->getOption('edit', 'standard'); + $sonataAdmin['inline'] = $fieldDescription->getOption('inline', 'natural'); + $sonataAdmin['block_name'] = $fieldDescription->getOption('block_name', false); + $sonataAdmin['class'] = $this->getClass($builder); + + $builder->setAttribute('sonata_admin_enabled', true); + } + + $builder->setAttribute('sonata_admin', $sonataAdmin); + } + + public function buildView(FormView $view, FormInterface $form, array $options) + { + $sonataAdmin = $form->getConfig()->getAttribute('sonata_admin'); + // NEXT_MAJOR: Remove this line + $sonataAdminHelp = $options['sonata_help'] ?? null; + + /* + * We have a child, so we need to upgrade block prefix + */ + if ($view->parent && $view->parent->vars['sonata_admin_enabled'] && !$sonataAdmin['admin']) { + $blockPrefixes = $view->vars['block_prefixes']; + $baseName = str_replace('.', '_', $view->parent->vars['sonata_admin_code']); + + $baseType = $blockPrefixes[\count($blockPrefixes) - 2]; + $blockSuffix = preg_replace('#^_([a-z0-9]{14})_(.++)$#', '$2', end($blockPrefixes)); + + $blockPrefixes[] = sprintf('%s_%s', $baseName, $baseType); + $blockPrefixes[] = sprintf('%s_%s_%s_%s', $baseName, $baseType, $view->parent->vars['name'], $view->vars['name']); + $blockPrefixes[] = sprintf('%s_%s_%s_%s', $baseName, $baseType, $view->parent->vars['name'], $blockSuffix); + + $view->vars['block_prefixes'] = array_unique($blockPrefixes); + $view->vars['sonata_admin_enabled'] = true; + $view->vars['sonata_admin'] = [ + 'admin' => false, + 'field_description' => false, + 'name' => false, + 'edit' => 'standard', + 'inline' => 'natural', + 'block_name' => false, + 'class' => false, + 'options' => $this->options, + ]; + // NEXT_MAJOR: Remove this line + $view->vars['sonata_help'] = $sonataAdminHelp; + $view->vars['sonata_admin_code'] = $view->parent->vars['sonata_admin_code']; + + return; + } + + // avoid to add extra information not required by non admin field + if ($sonataAdmin && $form->getConfig()->getAttribute('sonata_admin_enabled', true)) { + $sonataAdmin['value'] = $form->getData(); + + // add a new block types, so the Admin Form element can be tweaked based on the admin code + $blockPrefixes = $view->vars['block_prefixes']; + $baseName = str_replace('.', '_', $sonataAdmin['admin']->getCode()); + $baseType = $blockPrefixes[\count($blockPrefixes) - 2]; + $blockSuffix = preg_replace('#^_([a-z0-9]{14})_(.++)$#', '$2', end($blockPrefixes)); + + $blockPrefixes[] = sprintf('%s_%s', $baseName, $baseType); + $blockPrefixes[] = sprintf('%s_%s_%s', $baseName, $sonataAdmin['name'], $baseType); + $blockPrefixes[] = sprintf('%s_%s_%s_%s', $baseName, $sonataAdmin['name'], $baseType, $blockSuffix); + + if (isset($sonataAdmin['block_name']) && false !== $sonataAdmin['block_name']) { + $blockPrefixes[] = $sonataAdmin['block_name']; + } + + $view->vars['block_prefixes'] = array_unique($blockPrefixes); + $view->vars['sonata_admin_enabled'] = true; + $view->vars['sonata_admin'] = $sonataAdmin; + $view->vars['sonata_admin_code'] = $sonataAdmin['admin']->getCode(); + + $attr = $view->vars['attr']; + + if (!isset($attr['class']) && isset($sonataAdmin['class'])) { + $attr['class'] = $sonataAdmin['class']; + } + + $view->vars['attr'] = $attr; + } else { + $view->vars['sonata_admin_enabled'] = false; + } + + // NEXT_MAJOR: Remove this line + $view->vars['sonata_help'] = $sonataAdminHelp; + $view->vars['sonata_admin'] = $sonataAdmin; + } + + public function getExtendedType() + { + return FormType::class; + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver + ->setDefaults([ + 'sonata_admin' => null, + 'sonata_field_description' => null, + + // be compatible with mopa if not installed, avoid generating an exception for invalid option + 'label_render' => true, + // NEXT_MAJOR: Remove this property and the deprecation message + 'sonata_help' => null, + ]) + ->setDeprecated( + 'sonata_help', + 'The "sonata_help" option is deprecated since sonata-project/admin-bundle 3.60, to be removed in 4.0. Use "help" instead.' + ); + } + + /** + * return the value related to FieldDescription, if the associated object does no + * exists => a temporary one is created. + * + * @param object|null $object + * + * @return mixed + */ + public function getValueFromFieldDescription($object, FieldDescriptionInterface $fieldDescription) + { + $value = null; + + if (!$object) { + return null; + } + + try { + $value = $fieldDescription->getValue($object); + } catch (NoValueException $e) { + if ($fieldDescription->hasAssociationAdmin()) { + $value = $fieldDescription->getAssociationAdmin()->getNewInstance(); + } + } + + return $value; + } + + /** + * @return string + */ + protected function getClass(FormBuilderInterface $formBuilder) + { + foreach ($this->getTypes($formBuilder) as $type) { + $name = \get_class($type); + + if (isset($this->defaultClasses[$name])) { + return $this->defaultClasses[$name]; + } + } + + return ''; + } + + /** + * @return array + */ + protected function getTypes(FormBuilderInterface $formBuilder) + { + $types = []; + + for ($type = $formBuilder->getType(); null !== $type; $type = $type->getParent()) { + array_unshift($types, $type->getInnerType()); + } + + return $types; + } +} diff --git a/src/Form/Extension/Field/Type/BaseMopaCompatibilityTypeFieldExtension.php b/src/Form/Extension/Field/Type/BaseMopaCompatibilityTypeFieldExtension.php new file mode 100644 index 0000000000..519d731bce --- /dev/null +++ b/src/Form/Extension/Field/Type/BaseMopaCompatibilityTypeFieldExtension.php @@ -0,0 +1,49 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Sonata\AdminBundle\Form\Extension\Field\Type; + +use Symfony\Component\Form\AbstractTypeExtension; +use Symfony\Component\Form\Extension\Core\Type\FormType; +use Symfony\Component\Form\FormInterface; +use Symfony\Component\Form\FormView; +use Symfony\Component\OptionsResolver\OptionsResolver; + +/** + * NEXT_MAJOR: Copy its methods to ChoiceTypeExtension and remove it. + * + * @internal + */ +abstract class BaseMopaCompatibilityTypeFieldExtension extends AbstractTypeExtension +{ + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults([ + 'horizontal_label_class' => '', + 'horizontal_label_offset_class' => '', + 'horizontal_input_wrapper_class' => '', + ]); + } + + public function buildView(FormView $view, FormInterface $form, array $options) + { + $view->vars['horizontal_label_class'] = $options['horizontal_label_class']; + $view->vars['horizontal_label_offset_class'] = $options['horizontal_label_offset_class']; + $view->vars['horizontal_input_wrapper_class'] = $options['horizontal_input_wrapper_class']; + } + + public function getExtendedType() + { + return FormType::class; + } +} diff --git a/src/Form/Extension/Field/Type/FormTypeFieldExtension.php b/src/Form/Extension/Field/Type/FormTypeFieldExtension.php index 4884cfa18a..d29cdef826 100644 --- a/src/Form/Extension/Field/Type/FormTypeFieldExtension.php +++ b/src/Form/Extension/Field/Type/FormTypeFieldExtension.php @@ -13,246 +13,35 @@ namespace Sonata\AdminBundle\Form\Extension\Field\Type; -use Sonata\AdminBundle\Admin\FieldDescriptionInterface; -use Sonata\AdminBundle\Exception\NoValueException; -use Symfony\Component\Form\AbstractTypeExtension; use Symfony\Component\Form\Extension\Core\Type\FormType; -use Symfony\Component\Form\FormBuilderInterface; -use Symfony\Component\Form\FormInterface; -use Symfony\Component\Form\FormView; -use Symfony\Component\OptionsResolver\OptionsResolver; - -/** - * @final since sonata-project/admin-bundle 3.52 - * - * @author Thomas Rabaix - */ -class FormTypeFieldExtension extends AbstractTypeExtension -{ - /** - * @var array - */ - protected $defaultClasses = []; - - /** - * @var array - */ - protected $options = []; - - public function __construct(array $defaultClasses, array $options) - { - $this->defaultClasses = $defaultClasses; - $this->options = $options; - } - - public function buildForm(FormBuilderInterface $builder, array $options) - { - $sonataAdmin = [ - 'name' => null, - 'admin' => null, - 'value' => null, - 'edit' => 'standard', - 'inline' => 'natural', - 'field_description' => null, - 'block_name' => false, - 'options' => $this->options, - ]; - - $builder->setAttribute('sonata_admin_enabled', false); - // NEXT_MAJOR: Remove this line - $builder->setAttribute('sonata_help', false); - - if ($options['sonata_field_description'] instanceof FieldDescriptionInterface) { - $fieldDescription = $options['sonata_field_description']; - - $sonataAdmin['admin'] = $fieldDescription->getAdmin(); - $sonataAdmin['field_description'] = $fieldDescription; - $sonataAdmin['name'] = $fieldDescription->getName(); - $sonataAdmin['edit'] = $fieldDescription->getOption('edit', 'standard'); - $sonataAdmin['inline'] = $fieldDescription->getOption('inline', 'natural'); - $sonataAdmin['block_name'] = $fieldDescription->getOption('block_name', false); - $sonataAdmin['class'] = $this->getClass($builder); - - $builder->setAttribute('sonata_admin_enabled', true); - } - - $builder->setAttribute('sonata_admin', $sonataAdmin); - } - - public function buildView(FormView $view, FormInterface $form, array $options) - { - $sonataAdmin = $form->getConfig()->getAttribute('sonata_admin'); - // NEXT_MAJOR: Remove this line - $sonataAdminHelp = $options['sonata_help'] ?? null; - - /* - * We have a child, so we need to upgrade block prefix - */ - if ($view->parent && $view->parent->vars['sonata_admin_enabled'] && !$sonataAdmin['admin']) { - $blockPrefixes = $view->vars['block_prefixes']; - $baseName = str_replace('.', '_', $view->parent->vars['sonata_admin_code']); - - $baseType = $blockPrefixes[\count($blockPrefixes) - 2]; - $blockSuffix = preg_replace('#^_([a-z0-9]{14})_(.++)$#', '$2', end($blockPrefixes)); - - $blockPrefixes[] = sprintf('%s_%s', $baseName, $baseType); - $blockPrefixes[] = sprintf('%s_%s_%s_%s', $baseName, $baseType, $view->parent->vars['name'], $view->vars['name']); - $blockPrefixes[] = sprintf('%s_%s_%s_%s', $baseName, $baseType, $view->parent->vars['name'], $blockSuffix); - - $view->vars['block_prefixes'] = array_unique($blockPrefixes); - $view->vars['sonata_admin_enabled'] = true; - $view->vars['sonata_admin'] = [ - 'admin' => false, - 'field_description' => false, - 'name' => false, - 'edit' => 'standard', - 'inline' => 'natural', - 'block_name' => false, - 'class' => false, - 'options' => $this->options, - ]; - // NEXT_MAJOR: Remove this line - $view->vars['sonata_help'] = $sonataAdminHelp; - $view->vars['sonata_admin_code'] = $view->parent->vars['sonata_admin_code']; - - return; - } - - // avoid to add extra information not required by non admin field - if ($sonataAdmin && $form->getConfig()->getAttribute('sonata_admin_enabled', true)) { - $sonataAdmin['value'] = $form->getData(); - - // add a new block types, so the Admin Form element can be tweaked based on the admin code - $blockPrefixes = $view->vars['block_prefixes']; - $baseName = str_replace('.', '_', $sonataAdmin['admin']->getCode()); - $baseType = $blockPrefixes[\count($blockPrefixes) - 2]; - $blockSuffix = preg_replace('#^_([a-z0-9]{14})_(.++)$#', '$2', end($blockPrefixes)); - - $blockPrefixes[] = sprintf('%s_%s', $baseName, $baseType); - $blockPrefixes[] = sprintf('%s_%s_%s', $baseName, $sonataAdmin['name'], $baseType); - $blockPrefixes[] = sprintf('%s_%s_%s_%s', $baseName, $sonataAdmin['name'], $baseType, $blockSuffix); - - if (isset($sonataAdmin['block_name']) && false !== $sonataAdmin['block_name']) { - $blockPrefixes[] = $sonataAdmin['block_name']; - } - - $view->vars['block_prefixes'] = array_unique($blockPrefixes); - $view->vars['sonata_admin_enabled'] = true; - $view->vars['sonata_admin'] = $sonataAdmin; - $view->vars['sonata_admin_code'] = $sonataAdmin['admin']->getCode(); - - $attr = $view->vars['attr']; - - if (!isset($attr['class']) && isset($sonataAdmin['class'])) { - $attr['class'] = $sonataAdmin['class']; - } - - $view->vars['attr'] = $attr; - } else { - $view->vars['sonata_admin_enabled'] = false; - } - - // NEXT_MAJOR: Remove this line - $view->vars['sonata_help'] = $sonataAdminHelp; - $view->vars['sonata_admin'] = $sonataAdmin; - } - - public function getExtendedType() - { - return FormType::class; - } - - public static function getExtendedTypes(): iterable - { - return [FormType::class]; - } - - public function configureOptions(OptionsResolver $resolver) - { - $resolver - ->setDefaults([ - 'sonata_admin' => null, - 'sonata_field_description' => null, - - // be compatible with mopa if not installed, avoid generating an exception for invalid option - 'label_render' => true, - // NEXT_MAJOR: Remove this property and the deprecation message - 'sonata_help' => null, - ]); - - // BC layer for symfony/options-resolver < 5.1. - // @todo: Remove the check and the contents of the `else` condition when dropping the support for lower versions. - if (method_exists($resolver, 'getInfo')) { - $resolver - ->setDeprecated( - 'sonata_help', - 'sonata-project/admin-bundle', - '3.60', - 'The %name% option is deprecated since sonata-project/admin-bundle 3.60, to be removed in 4.0. Use "help" instead.' - ); - } else { - $resolver - ->setDeprecated( - 'sonata_help', - 'The "sonata_help" option is deprecated since sonata-project/admin-bundle 3.60, to be removed in 4.0. Use "help" instead.' - ); - } - } +use Symfony\Component\Form\FormTypeExtensionInterface; +// NEXT_MAJOR: Remove the "else" part, copy all methods from BaseFormTypeFieldExtension in this class and +// extend from AbstractTypeExtension. +if (method_exists(FormTypeExtensionInterface::class, 'getExtendedTypes')) { /** - * return the value related to FieldDescription, if the associated object does no - * exists => a temporary one is created. + * @final since sonata-project/admin-bundle 3.52 * - * @param object|null $object - * - * @return mixed + * @author Thomas Rabaix */ - public function getValueFromFieldDescription($object, FieldDescriptionInterface $fieldDescription) + class FormTypeFieldExtension extends BaseFormTypeFieldExtension { - $value = null; - - if (!$object) { - return null; + public static function getExtendedTypes(): iterable + { + return [FormType::class]; } - - try { - $value = $fieldDescription->getValue($object); - } catch (NoValueException $e) { - if ($fieldDescription->hasAssociationAdmin()) { - $value = $fieldDescription->getAssociationAdmin()->getNewInstance(); - } - } - - return $value; } - +} else { /** - * @return string - */ - protected function getClass(FormBuilderInterface $formBuilder) - { - foreach ($this->getTypes($formBuilder) as $type) { - $name = \get_class($type); - - if (isset($this->defaultClasses[$name])) { - return $this->defaultClasses[$name]; - } - } - - return ''; - } - - /** - * @return array + * @final since sonata-project/admin-bundle 3.52 + * + * @author Thomas Rabaix */ - protected function getTypes(FormBuilderInterface $formBuilder) + class FormTypeFieldExtension extends BaseFormTypeFieldExtension { - $types = []; - - for ($type = $formBuilder->getType(); null !== $type; $type = $type->getParent()) { - array_unshift($types, $type->getInnerType()); + public static function getExtendedTypes() + { + return [FormType::class]; } - - return $types; } } diff --git a/src/Form/Extension/Field/Type/MopaCompatibilityTypeFieldExtension.php b/src/Form/Extension/Field/Type/MopaCompatibilityTypeFieldExtension.php index 9c646700fd..e7f24e43fb 100644 --- a/src/Form/Extension/Field/Type/MopaCompatibilityTypeFieldExtension.php +++ b/src/Form/Extension/Field/Type/MopaCompatibilityTypeFieldExtension.php @@ -13,45 +13,41 @@ namespace Sonata\AdminBundle\Form\Extension\Field\Type; -use Symfony\Component\Form\AbstractTypeExtension; use Symfony\Component\Form\Extension\Core\Type\FormType; -use Symfony\Component\Form\FormInterface; -use Symfony\Component\Form\FormView; -use Symfony\Component\OptionsResolver\OptionsResolver; - -/** - * This class is built to allow AdminInterface to work properly - * if the MopaBootstrapBundle is not installed. - * - * @final since sonata-project/admin-bundle 3.52 - * - * @author Thomas Rabaix - */ -class MopaCompatibilityTypeFieldExtension extends AbstractTypeExtension -{ - public function configureOptions(OptionsResolver $resolver) +use Symfony\Component\Form\FormTypeExtensionInterface; + +// NEXT_MAJOR: Remove the "else" part, copy all methods from BaseMopaCompatibilityTypeFieldExtension in this class and +// extend from AbstractTypeExtension +if (method_exists(FormTypeExtensionInterface::class, 'getExtendedTypes')) { + /** + * This class is built to allow AdminInterface to work properly + * if the MopaBootstrapBundle is not installed. + * + * @final since sonata-project/admin-bundle 3.52 + * + * @author Thomas Rabaix + */ + class MopaCompatibilityTypeFieldExtension extends BaseMopaCompatibilityTypeFieldExtension { - $resolver->setDefaults([ - 'horizontal_label_class' => '', - 'horizontal_label_offset_class' => '', - 'horizontal_input_wrapper_class' => '', - ]); + public static function getExtendedTypes(): iterable + { + return [FormType::class]; + } } - - public function buildView(FormView $view, FormInterface $form, array $options) - { - $view->vars['horizontal_label_class'] = $options['horizontal_label_class']; - $view->vars['horizontal_label_offset_class'] = $options['horizontal_label_offset_class']; - $view->vars['horizontal_input_wrapper_class'] = $options['horizontal_input_wrapper_class']; - } - - public function getExtendedType() - { - return FormType::class; - } - - public static function getExtendedTypes(): iterable +} else { + /** + * This class is built to allow AdminInterface to work properly + * if the MopaBootstrapBundle is not installed. + * + * @final since sonata-project/admin-bundle 3.52 + * + * @author Thomas Rabaix + */ + class MopaCompatibilityTypeFieldExtension extends BaseMopaCompatibilityTypeFieldExtension { - return [FormType::class]; + public static function getExtendedTypes() + { + return [FormType::class]; + } } }