|
@@ -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(),
|
|
|
));
|
|
|
}
|
|
|
|