X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FForm%2FType%2FNewUserType.php;h=ffbe9ba27b6a33209fc42aaeac05591d07ac16d0;hb=5c895a7fd15822856fb407910264c5d95e1e223c;hp=8aabc8bbbc40ecffdaabc6543e7a0928678329a9;hpb=1210dae10589515d6f3824c75639342c5e1d52dd;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php index 8aabc8bb..ffbe9ba2 100644 --- a/src/Wallabag/CoreBundle/Form/Type/NewUserType.php +++ b/src/Wallabag/CoreBundle/Form/Type/NewUserType.php @@ -3,6 +3,11 @@ namespace Wallabag\CoreBundle\Form\Type; use Symfony\Component\Form\AbstractType; +use Symfony\Component\Form\Extension\Core\Type\EmailType; +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\Extension\Core\Type\TextType; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Validator\Constraints; @@ -12,9 +17,9 @@ class NewUserType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('username', 'text', array('required' => true)) - ->add('plainPassword', 'repeated', array( - 'type' => 'password', + ->add('username', TextType::class, array('required' => true)) + ->add('plainPassword', RepeatedType::class, array( + 'type' => PasswordType::class, 'constraints' => array( new Constraints\Length(array( 'min' => 8, @@ -23,8 +28,8 @@ class NewUserType extends AbstractType new Constraints\NotBlank(), ), )) - ->add('email', 'email') - ->add('save', 'submit') + ->add('email', EmailType::class) + ->add('save', SubmitType::class) ; } @@ -35,7 +40,7 @@ class NewUserType extends AbstractType )); } - public function getName() + public function getBlockPrefix() { return 'new_user'; }