fix deprecations: getName, configureOptions, and use fqcn

This commit is contained in:
nobohan 2018-04-04 14:42:01 +02:00
parent ba79200e55
commit 2eb81ab3ec

View File

@ -23,7 +23,8 @@ namespace Chill\PersonBundle\Form;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface; use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Chill\PersonBundle\Form\Type\GenderType; use Chill\PersonBundle\Form\Type\GenderType;
use Chill\MainBundle\Form\Type\Select2CountryType; use Chill\MainBundle\Form\Type\Select2CountryType;
@ -63,7 +64,7 @@ class PersonType extends AbstractType
->add('gender', new GenderType(), array( ->add('gender', new GenderType(), array(
'required' => true 'required' => true
)) ))
->add('memo', 'textarea', array('required' => false)) ->add('memo', TextareaType::class, array('required' => false))
; ;
if ($this->config['place_of_birth'] === 'visible') { if ($this->config['place_of_birth'] === 'visible') {
@ -71,11 +72,11 @@ class PersonType extends AbstractType
} }
if ($this->config['phonenumber'] === 'visible') { if ($this->config['phonenumber'] === 'visible') {
$builder->add('phonenumber', 'textarea', array('required' => false)); $builder->add('phonenumber', TextareaType::class, array('required' => false));
} }
if ($this->config['email'] === 'visible') { if ($this->config['email'] === 'visible') {
$builder->add('email', 'textarea', array('required' => false)); $builder->add('email', TextareaType::class, array('required' => false));
} }
if ($this->config['country_of_birth'] === 'visible') { if ($this->config['country_of_birth'] === 'visible') {
@ -114,7 +115,7 @@ class PersonType extends AbstractType
/** /**
* @param OptionsResolverInterface $resolver * @param OptionsResolverInterface $resolver
*/ */
public function setDefaultOptions(OptionsResolverInterface $resolver) public function configureOptions(OptionsResolver $resolver)
{ {
$resolver->setDefaults(array( $resolver->setDefaults(array(
'data_class' => 'Chill\PersonBundle\Entity\Person', 'data_class' => 'Chill\PersonBundle\Entity\Person',
@ -125,15 +126,15 @@ class PersonType extends AbstractType
'cFGroup' 'cFGroup'
)); ));
$resolver->setAllowedTypes(array( $resolver->setAllowedTypes(
'cFGroup' => array('null', 'Chill\CustomFieldsBundle\Entity\CustomFieldsGroup') 'cFGroup', array('null', 'Chill\CustomFieldsBundle\Entity\CustomFieldsGroup')
)); );
} }
/** /**
* @return string * @return string
*/ */
public function getName() public function getBlockPrefix()
{ {
return 'chill_personbundle_person'; return 'chill_personbundle_person';
} }