<?php
namespace Platform\SecurityBundle\Form\Type;
use EWZ\Bundle\RecaptchaBundle\Form\Type\EWZRecaptchaV3Type;
use EWZ\Bundle\RecaptchaBundle\Validator\Constraints\IsTrueV3;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Validator\Constraints\NotBlank;
use Symfony\Component\Validator\Constraints\NotNull;
/**
* Class SignInType
*
* @package Platform\SecurityBundle\Form\Type
*/
final class SignInType extends AbstractType
{
/**
* {@inheritdoc}
*/
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('email', TextType::class, array(
'attr' => array(
'autocomplete' => 'on',
),
'constraints' => array(
new NotBlank(),
new NotNull(),
)
))
->add('recaptcha', EWZRecaptchaV3Type::class, array(
'constraints' => array(
new IsTrueV3(),
)
))
;
}
}