From 71a375b37d3fac6306806c29fa972b9ddcba1061 Mon Sep 17 00:00:00 2001 From: nobohan Date: Wed, 4 Apr 2018 16:40:36 +0200 Subject: [PATCH] fix deprecations: use fqcn instead of 'choice' --- Form/Type/GenderType.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Form/Type/GenderType.php b/Form/Type/GenderType.php index a3caf2e7a..1292fd2a3 100644 --- a/Form/Type/GenderType.php +++ b/Form/Type/GenderType.php @@ -4,6 +4,8 @@ namespace Chill\PersonBundle\Form\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\OptionsResolver\OptionsResolverInterface; +use Symfony\Component\Form\Extension\Core\Type\ChoiceType; + use Chill\PersonBundle\Entity\Person; /** @@ -12,24 +14,24 @@ use Chill\PersonBundle\Entity\Person; * @author julien */ class GenderType extends AbstractType { - - + + public function getName() { return 'gender'; } - + public function getParent() { - return 'choice'; + return ChoiceType::class; } - + public function setDefaultOptions(OptionsResolverInterface $resolver) { - + $a = array( Person::MALE_GENDER => Person::MALE_GENDER, Person::FEMALE_GENDER => Person::FEMALE_GENDER ); - - $resolver->setDefaults(array( + + $resolver->setDefaults(array( 'choices' => $a, 'expanded' => true, 'multiple' => false,