Browse Source

Cleanup password stuff

No need to support old Sf as pointed out by stof so stripped that,
and remove call-by-ref to avoid insane memory usage
Dave Shoreman 11 years ago
parent
commit
d014a1461d
1 changed files with 2 additions and 9 deletions
  1. 2 9
      src/Packagist/WebBundle/Form/Type/ProfileFormType.php

+ 2 - 9
src/Packagist/WebBundle/Form/Type/ProfileFormType.php

@@ -54,20 +54,13 @@ class ProfileFormType extends BaseType
         ));
     }
 
-    private function addPasswordField(&$event)
+    private function addPasswordField($event)
     {
-        if (class_exists('Symfony\Component\Security\Core\Validator\Constraints\UserPassword')) {
-            $constraint = new UserPassword();
-        } else {
-            // Symfony 2.1 support with the old constraint class
-            $constraint = new OldUserPassword();
-        }
-
         $event->getForm()->add('current_password', 'password', array(
             'label' => 'form.current_password',
             'translation_domain' => 'FOSUserBundle',
             'mapped' => false,
-            'constraints' => $constraint,
+            'constraints' => new UserPassword(),
         ));
     }