]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Form/Type/ChangePasswordType.php
Merge pull request #1916 from wallabag/cleanup
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Form / Type / ChangePasswordType.php
index 7d05a5d81442cb5f3ba04852f7c33b3fcd8b47fc..81c4a6166708992524d22a4214d5a72ed04adf24 100644 (file)
@@ -15,24 +15,28 @@ class ChangePasswordType extends AbstractType
     public function buildForm(FormBuilderInterface $builder, array $options)
     {
         $builder
-            ->add('old_password', PasswordType::class, array(
-                'constraints' => new UserPassword(array('message' => 'Wrong value for your current password')),
-            ))
-            ->add('new_password', RepeatedType::class, array(
+            ->add('old_password', PasswordType::class, [
+                'constraints' => new UserPassword(['message' => 'validator.password_wrong_value']),
+                'label' => 'config.form_password.old_password_label',
+            ])
+            ->add('new_password', RepeatedType::class, [
                 'type' => PasswordType::class,
-                'invalid_message' => 'The password fields must match.',
+                'invalid_message' => 'validator.password_must_match',
                 'required' => true,
-                'first_options' => array('label' => 'New password'),
-                'second_options' => array('label' => 'Repeat new password'),
-                'constraints' => array(
-                    new Constraints\Length(array(
+                'first_options' => ['label' => 'config.form_password.new_password_label'],
+                'second_options' => ['label' => 'config.form_password.repeat_new_password_label'],
+                'constraints' => [
+                    new Constraints\Length([
                         'min' => 8,
-                        'minMessage' => 'Password should by at least 8 chars long',
-                    )),
+                        'minMessage' => 'validator.password_too_short',
+                    ]),
                     new Constraints\NotBlank(),
-                ),
-            ))
-            ->add('save', SubmitType::class)
+                ],
+                'label' => 'config.form_password.new_password_label',
+            ])
+            ->add('save', SubmitType::class, [
+                'label' => 'config.form.save',
+            ])
         ;
     }