fix deprecations: replace many strings by fqcn

This commit is contained in:
nobohan 2018-04-04 15:02:16 +02:00
parent 2eb81ab3ec
commit 678386ffd6
7 changed files with 168 additions and 159 deletions

View File

@ -23,6 +23,7 @@
namespace Chill\PersonBundle\Controller; namespace Chill\PersonBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Chill\PersonBundle\Entity\Person; use Chill\PersonBundle\Entity\Person;
use Chill\MainBundle\Form\Type\AddressType; use Chill\MainBundle\Form\Type\AddressType;
use Chill\MainBundle\Entity\Address; use Chill\MainBundle\Entity\Address;
@ -239,7 +240,7 @@ class PersonAddressController extends Controller
)) ))
)); ));
$form->add('submit', 'submit', array( $form->add('submit', SubmitType::class, array(
'label' => 'Submit' 'label' => 'Submit'
)); ));
@ -261,7 +262,7 @@ class PersonAddressController extends Controller
)) ))
)); ));
$form->add('submit', 'submit', array( $form->add('submit', SubmitType::class, array(
'label' => 'Submit' 'label' => 'Submit'
)); ));

View File

@ -30,6 +30,7 @@ use Symfony\Component\Security\Core\Role\Role;
use Chill\PersonBundle\Security\Authorization\PersonVoter; use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Chill\MainBundle\Export\ExportElementValidatedInterface; use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
/** /**
@ -75,7 +76,7 @@ class CountryOfBirthAggregator implements AggregatorInterface,
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder->add('group_by_level', 'choice', array( $builder->add('group_by_level', ChoiceType::class, array(
'choices' => array( 'choices' => array(
'Group by continents' => 'continent', 'Group by continents' => 'continent',
'Group by country' => 'country' 'Group by country' => 'country'

View File

@ -30,6 +30,7 @@ use Symfony\Component\Security\Core\Role\Role;
use Chill\PersonBundle\Security\Authorization\PersonVoter; use Chill\PersonBundle\Security\Authorization\PersonVoter;
use Chill\MainBundle\Export\ExportElementValidatedInterface; use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
/** /**
* *
@ -74,7 +75,7 @@ class NationalityAggregator implements AggregatorInterface,
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder->add('group_by_level', 'choice', array( $builder->add('group_by_level', ChoiceType::class, array(
'choices' => array( 'choices' => array(
'Group by continents' => 'continent', 'Group by continents' => 'continent',
'Group by country' => 'country' 'Group by country' => 'country'

View File

@ -27,6 +27,7 @@ use Doctrine\ORM\Query\Expr;
use Symfony\Component\Security\Core\Role\Role; use Symfony\Component\Security\Core\Role\Role;
use Chill\MainBundle\Export\ExportElementValidatedInterface; use Chill\MainBundle\Export\ExportElementValidatedInterface;
use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
/** /**
* *
@ -47,7 +48,7 @@ class GenderFilter implements FilterInterface,
*/ */
public function buildForm(FormBuilderInterface $builder) public function buildForm(FormBuilderInterface $builder)
{ {
$builder->add('accepted_genders', 'choice', array( $builder->add('accepted_genders', ChoiceType::class, array(
'choices' => array( 'choices' => array(
Person::FEMALE_GENDER => 'Woman', Person::FEMALE_GENDER => 'Woman',
Person::MALE_GENDER => 'Man' Person::MALE_GENDER => 'Man'

View File

@ -9,6 +9,7 @@ use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormEvent; use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormView; use Symfony\Component\Form\FormView;
use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
class AccompanyingPeriodType extends AbstractType class AccompanyingPeriodType extends AbstractType
{ {
@ -50,7 +51,7 @@ class AccompanyingPeriodType extends AbstractType
} }
}); });
$builder->add('remark', 'textarea', array( $builder->add('remark', TextareaType::class, array(
'required' => false 'required' => false
)) ))
; ;

View File

@ -24,8 +24,10 @@ 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\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
use Chill\PersonBundle\Form\Type\GenderType;
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer; use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer;
use Symfony\Component\Form\Extension\Core\Type\HiddenType;
use Chill\PersonBundle\Form\Type\GenderType;
use Chill\MainBundle\Form\Type\DataTransformer\CenterTransformer; use Chill\MainBundle\Form\Type\DataTransformer\CenterTransformer;
class CreationPersonType extends AbstractType class CreationPersonType extends AbstractType
@ -58,20 +60,20 @@ class CreationPersonType extends AbstractType
$dateToStringTransformer = new DateTimeToStringTransformer( $dateToStringTransformer = new DateTimeToStringTransformer(
null, null, 'd-m-Y', false); null, null, 'd-m-Y', false);
$builder->add('firstName', 'hidden') $builder->add('firstName', HiddenType::class)
->add('lastName', 'hidden') ->add('lastName', HiddenType::class)
->add('birthdate', 'hidden', array( ->add('birthdate', HiddenType::class, array(
'property_path' => 'birthdate' 'property_path' => 'birthdate'
)) ))
->add('gender', 'hidden') ->add('gender', HiddenType::class)
->add('creation_date', 'hidden', array( ->add('creation_date', HiddenType::class, array(
'mapped' => false 'mapped' => false
)) ))
->add('form_status', 'hidden', array( ->add('form_status', HiddenType::class, array(
'mapped' => false, 'mapped' => false,
'data' => $options['form_status'] 'data' => $options['form_status']
)) ))
->add('center', 'hidden') ->add('center', HiddenType::class)
; ;
$builder->get('birthdate') $builder->get('birthdate')
->addModelTransformer($dateToStringTransformer); ->addModelTransformer($dateToStringTransformer);
@ -94,7 +96,7 @@ class CreationPersonType extends AbstractType
'format' => 'dd-MM-yyyy', 'format' => 'dd-MM-yyyy',
'mapped' => false, 'mapped' => false,
'data' => new \DateTime())) 'data' => new \DateTime()))
->add('form_status', 'hidden', array( ->add('form_status', HiddenType::class, array(
'data' => $options['form_status'], 'data' => $options['form_status'],
'mapped' => false 'mapped' => false
)) ))

View File

@ -25,10 +25,12 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Form\Extension\Core\Type\TextareaType; use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Chill\PersonBundle\Form\Type\GenderType; use Chill\PersonBundle\Form\Type\GenderType;
use Chill\MainBundle\Form\Type\Select2CountryType; use Chill\MainBundle\Form\Type\Select2CountryType;
use Chill\MainBundle\Form\Type\Select2LanguageType; use Chill\MainBundle\Form\Type\Select2LanguageType;
use Chill\CustomFieldsBundle\Form\Type\CustomFieldType;
class PersonType extends AbstractType class PersonType extends AbstractType
{ {
@ -68,7 +70,7 @@ class PersonType extends AbstractType
; ;
if ($this->config['place_of_birth'] === 'visible') { if ($this->config['place_of_birth'] === 'visible') {
$builder->add('placeOfBirth', 'text', array('required' => false)); $builder->add('placeOfBirth', TextType::class, array('required' => false));
} }
if ($this->config['phonenumber'] === 'visible') { if ($this->config['phonenumber'] === 'visible') {
@ -106,7 +108,7 @@ class PersonType extends AbstractType
if($options['cFGroup']) { if($options['cFGroup']) {
$builder $builder
->add('cFData', 'custom_field', ->add('cFData', CustomFieldType::class,
array('attr' => array('class' => 'cf-fields'), 'group' => $options['cFGroup'])) array('attr' => array('class' => 'cf-fields'), 'group' => $options['cFGroup']))
; ;
} }