]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php
Symfony Upgrade Fixer FTW
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Form / Type / ChangePasswordType.php
index 82e1954d1a871906c5220ff6a5bbf39edbf01e53..615b81690653b1ba34035d217df10846f11e6ee6 100644 (file)
@@ -3,6 +3,9 @@
 namespace Wallabag\CoreBundle\Form\Type;
 
 use Symfony\Component\Form\AbstractType;
+use Symfony\Component\Form\Extension\Core\Type\PasswordType;
+use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
+use Symfony\Component\Form\Extension\Core\Type\SubmitType;
 use Symfony\Component\Form\FormBuilderInterface;
 use Symfony\Component\Security\Core\Validator\Constraints\UserPassword;
 use Symfony\Component\Validator\Constraints;
@@ -12,10 +15,10 @@ class ChangePasswordType extends AbstractType
     public function buildForm(FormBuilderInterface $builder, array $options)
     {
         $builder
-            ->add('old_password', 'password', array(
+            ->add('old_password', PasswordType::class, array(
                 'constraints' => new UserPassword(array('message' => 'Wrong value for your current password')),
             ))
-            ->add('new_password', 'repeated', array(
+            ->add('new_password', RepeatedType::class, array(
                 'type' => 'password',
                 'invalid_message' => 'The password fields must match.',
                 'required' => true,
@@ -29,11 +32,11 @@ class ChangePasswordType extends AbstractType
                     new Constraints\NotBlank(),
                 ),
             ))
-            ->add('save', 'submit')
+            ->add('save', SubmitType::class)
         ;
     }
 
-    public function getName()
+    public function getBlockPrefix()
     {
         return 'change_passwd';
     }