From 85018f1927f9f5e9a8bef0316f6d4b1980ad46a4 Mon Sep 17 00:00:00 2001 From: nobohan Date: Fri, 30 Mar 2018 14:06:54 +0200 Subject: [PATCH] =?UTF-8?q?fix=20deprecations:=20getName=20=E2=86=92=20get?= =?UTF-8?q?BlockPrefix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Form/CenterType.php | 12 +++++++----- Form/PermissionsGroupType.php | 4 ++-- Form/ScopeType.php | 4 ++-- Form/UserPasswordType.php | 8 ++++---- Form/UserType.php | 8 ++++---- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/Form/CenterType.php b/Form/CenterType.php index 8a7291cc2..9ab037304 100644 --- a/Form/CenterType.php +++ b/Form/CenterType.php @@ -5,6 +5,7 @@ namespace Chill\MainBundle\Form; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; +use Symfony\Component\Form\Extension\Core\Type\TextType; class CenterType extends AbstractType { @@ -15,10 +16,10 @@ class CenterType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('name') + ->add('name', TextType::class) ; } - + /** * @param OptionsResolverInterface $resolver */ @@ -32,8 +33,9 @@ class CenterType extends AbstractType /** * @return string */ - public function getName() + public function getBlockPrefix() { - return 'chill_mainbundle_center'; - } + return 'chill_mainbundle_center'; + } + } diff --git a/Form/PermissionsGroupType.php b/Form/PermissionsGroupType.php index 6a43865b1..f36fa220c 100644 --- a/Form/PermissionsGroupType.php +++ b/Form/PermissionsGroupType.php @@ -18,7 +18,7 @@ class PermissionsGroupType extends AbstractType ->add('name') ; } - + /** * @param OptionsResolverInterface $resolver */ @@ -32,7 +32,7 @@ class PermissionsGroupType extends AbstractType /** * @return string */ - public function getName() + public function getBlockPrefix() { return 'chill_mainbundle_permissionsgroup'; } diff --git a/Form/ScopeType.php b/Form/ScopeType.php index eebdd726a..dc248613a 100644 --- a/Form/ScopeType.php +++ b/Form/ScopeType.php @@ -18,7 +18,7 @@ class ScopeType extends AbstractType ->add('name', 'translatable_string') ; } - + /** * @param OptionsResolverInterface $resolver */ @@ -32,7 +32,7 @@ class ScopeType extends AbstractType /** * @return string */ - public function getName() + public function getBlockPrefix() { return 'chill_mainbundle_scope'; } diff --git a/Form/UserPasswordType.php b/Form/UserPasswordType.php index 827688b3d..d40a3266b 100644 --- a/Form/UserPasswordType.php +++ b/Form/UserPasswordType.php @@ -24,14 +24,14 @@ class UserPasswordType extends AbstractType 'options' => array(), 'first_options' => array( 'label' => 'Password' - ), + ), 'second_options' => array( 'label' => 'Repeat the password' ), 'invalid_message' => "The password fields must match", 'constraints' => array( new Length(array( - 'min' => 9, + 'min' => 9, 'minMessage' => 'The password must be greater than {{ limit }} characters' )), new NotBlank(), @@ -45,7 +45,7 @@ class UserPasswordType extends AbstractType )) ; } - + /** * @param OptionsResolverInterface $resolver */ @@ -59,7 +59,7 @@ class UserPasswordType extends AbstractType /** * @return string */ - public function getName() + public function getBlockPrefix() { return 'chill_mainbundle_user_password'; } diff --git a/Form/UserType.php b/Form/UserType.php index 14bc72b43..94257c734 100644 --- a/Form/UserType.php +++ b/Form/UserType.php @@ -22,7 +22,7 @@ class UserType extends AbstractType $builder->add('plainPassword', new UserPasswordType(), array( 'mapped' => false )); - + } else { $builder->add($builder ->create('enabled', 'choice', array( @@ -36,7 +36,7 @@ class UserType extends AbstractType ); } } - + /** * @param OptionsResolverInterface $resolver */ @@ -45,7 +45,7 @@ class UserType extends AbstractType $resolver->setDefaults(array( 'data_class' => 'Chill\MainBundle\Entity\User' )); - + $resolver ->setDefaults(array('is_creation' => false)) ->addAllowedValues(array('is_creation' => array(true, false))) @@ -55,7 +55,7 @@ class UserType extends AbstractType /** * @return string */ - public function getName() + public function getBlockPrefix() { return 'chill_mainbundle_user'; }