fix deprecations: getName → getBlockPrefix

This commit is contained in:
nobohan 2018-03-30 14:06:54 +02:00
parent ffd2ee6f69
commit 85018f1927
5 changed files with 19 additions and 17 deletions

View File

@ -5,6 +5,7 @@ namespace Chill\MainBundle\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 Symfony\Component\Form\Extension\Core\Type\TextType;
class CenterType extends AbstractType class CenterType extends AbstractType
{ {
@ -15,10 +16,10 @@ class CenterType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
{ {
$builder $builder
->add('name') ->add('name', TextType::class)
; ;
} }
/** /**
* @param OptionsResolverInterface $resolver * @param OptionsResolverInterface $resolver
*/ */
@ -32,8 +33,9 @@ class CenterType extends AbstractType
/** /**
* @return string * @return string
*/ */
public function getName() public function getBlockPrefix()
{ {
return 'chill_mainbundle_center'; return 'chill_mainbundle_center';
} }
} }

View File

@ -18,7 +18,7 @@ class PermissionsGroupType extends AbstractType
->add('name') ->add('name')
; ;
} }
/** /**
* @param OptionsResolverInterface $resolver * @param OptionsResolverInterface $resolver
*/ */
@ -32,7 +32,7 @@ class PermissionsGroupType extends AbstractType
/** /**
* @return string * @return string
*/ */
public function getName() public function getBlockPrefix()
{ {
return 'chill_mainbundle_permissionsgroup'; return 'chill_mainbundle_permissionsgroup';
} }

View File

@ -18,7 +18,7 @@ class ScopeType extends AbstractType
->add('name', 'translatable_string') ->add('name', 'translatable_string')
; ;
} }
/** /**
* @param OptionsResolverInterface $resolver * @param OptionsResolverInterface $resolver
*/ */
@ -32,7 +32,7 @@ class ScopeType extends AbstractType
/** /**
* @return string * @return string
*/ */
public function getName() public function getBlockPrefix()
{ {
return 'chill_mainbundle_scope'; return 'chill_mainbundle_scope';
} }

View File

@ -24,14 +24,14 @@ class UserPasswordType extends AbstractType
'options' => array(), 'options' => array(),
'first_options' => array( 'first_options' => array(
'label' => 'Password' 'label' => 'Password'
), ),
'second_options' => array( 'second_options' => array(
'label' => 'Repeat the password' 'label' => 'Repeat the password'
), ),
'invalid_message' => "The password fields must match", 'invalid_message' => "The password fields must match",
'constraints' => array( 'constraints' => array(
new Length(array( new Length(array(
'min' => 9, 'min' => 9,
'minMessage' => 'The password must be greater than {{ limit }} characters' 'minMessage' => 'The password must be greater than {{ limit }} characters'
)), )),
new NotBlank(), new NotBlank(),
@ -45,7 +45,7 @@ class UserPasswordType extends AbstractType
)) ))
; ;
} }
/** /**
* @param OptionsResolverInterface $resolver * @param OptionsResolverInterface $resolver
*/ */
@ -59,7 +59,7 @@ class UserPasswordType extends AbstractType
/** /**
* @return string * @return string
*/ */
public function getName() public function getBlockPrefix()
{ {
return 'chill_mainbundle_user_password'; return 'chill_mainbundle_user_password';
} }

View File

@ -22,7 +22,7 @@ class UserType extends AbstractType
$builder->add('plainPassword', new UserPasswordType(), array( $builder->add('plainPassword', new UserPasswordType(), array(
'mapped' => false 'mapped' => false
)); ));
} else { } else {
$builder->add($builder $builder->add($builder
->create('enabled', 'choice', array( ->create('enabled', 'choice', array(
@ -36,7 +36,7 @@ class UserType extends AbstractType
); );
} }
} }
/** /**
* @param OptionsResolverInterface $resolver * @param OptionsResolverInterface $resolver
*/ */
@ -45,7 +45,7 @@ class UserType extends AbstractType
$resolver->setDefaults(array( $resolver->setDefaults(array(
'data_class' => 'Chill\MainBundle\Entity\User' 'data_class' => 'Chill\MainBundle\Entity\User'
)); ));
$resolver $resolver
->setDefaults(array('is_creation' => false)) ->setDefaults(array('is_creation' => false))
->addAllowedValues(array('is_creation' => array(true, false))) ->addAllowedValues(array('is_creation' => array(true, false)))
@ -55,7 +55,7 @@ class UserType extends AbstractType
/** /**
* @return string * @return string
*/ */
public function getName() public function getBlockPrefix()
{ {
return 'chill_mainbundle_user'; return 'chill_mainbundle_user';
} }