fix deprecations: use fqcn instead of 'choice'

This commit is contained in:
nobohan 2018-04-04 16:40:36 +02:00
parent 2ac4a84114
commit 71a375b37d

View File

@ -4,6 +4,8 @@ namespace Chill\PersonBundle\Form\Type;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\OptionsResolver\OptionsResolverInterface; use Symfony\Component\OptionsResolver\OptionsResolverInterface;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\Person;
/** /**
@ -12,24 +14,24 @@ use Chill\PersonBundle\Entity\Person;
* @author julien * @author julien
*/ */
class GenderType extends AbstractType { class GenderType extends AbstractType {
public function getName() { public function getName() {
return 'gender'; return 'gender';
} }
public function getParent() { public function getParent() {
return 'choice'; return ChoiceType::class;
} }
public function setDefaultOptions(OptionsResolverInterface $resolver) { public function setDefaultOptions(OptionsResolverInterface $resolver) {
$a = array( $a = array(
Person::MALE_GENDER => Person::MALE_GENDER, Person::MALE_GENDER => Person::MALE_GENDER,
Person::FEMALE_GENDER => Person::FEMALE_GENDER Person::FEMALE_GENDER => Person::FEMALE_GENDER
); );
$resolver->setDefaults(array( $resolver->setDefaults(array(
'choices' => $a, 'choices' => $a,
'expanded' => true, 'expanded' => true,
'multiple' => false, 'multiple' => false,