src/Platform/SecurityBundle/Form/Type/SignInType.php line 18

Open in your IDE?
  1. <?php
  2. namespace Platform\SecurityBundle\Form\Type;
  3. use EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaV3Type;
  4. use EWZ\Bundle\RecaptchaBundle\Validator\Constraints\IsTrueV3;
  5. use Symfony\Component\Form\AbstractType;
  6. use Symfony\Component\Form\FormBuilderInterface;
  7. use Symfony\Component\Form\Extension\Core\Type\TextType;
  8. use Symfony\Component\Validator\Constraints\NotBlank;
  9. use Symfony\Component\Validator\Constraints\NotNull;
  10. /**
  11.  * Class SignInType
  12.  *
  13.  * @package Platform\SecurityBundle\Form\Type
  14.  */
  15. final class SignInType extends AbstractType
  16. {
  17.     /**
  18.      * {@inheritdoc}
  19.      */
  20.     public function buildForm(FormBuilderInterface $builder, array $options)
  21.     {
  22.         $builder
  23.             ->add('email'TextType::class, array(
  24.                 'attr' => array(
  25.                     'autocomplete' => 'on',
  26.                 ),
  27.                 'constraints' => array(
  28.                     new NotBlank(),
  29.                     new NotNull(),
  30.                 )
  31.             ))
  32.             ->add('recaptcha'EWZRecaptchaV3Type::class, array(
  33.                 'constraints' => array(
  34.                     new IsTrueV3(),
  35.                 )
  36.             ))
  37.         ;
  38.     }
  39. }