OtpVerificationType::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace DoS\UserBundle\Confirmation\Form\Type;
4
5
use DoS\UserBundle\Confirmation\Form\EventListener\SubjectAdderListener;
6
use DoS\UserBundle\Confirmation\OTP\Confirmation;
7
use Symfony\Component\Form\AbstractType;
8
use Symfony\Component\Form\FormBuilderInterface;
9
10
class OtpVerificationType extends AbstractType
11
{
12
    /**
13
     * @var Confirmation
14
     */
15
    protected $confirmation;
16
17
    public function __construct(Confirmation $confirmation)
18
    {
19
        $this->confirmation = $confirmation;
20
    }
21
22
    public function buildForm(FormBuilderInterface $builder, array $options = array())
23
    {
24
        $builder
25
            ->add('token', 'hidden')
26
            ->add('otp', 'text')
27
        ;
28
29
        $builder->addEventSubscriber(new SubjectAdderListener($this->confirmation));
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function getName()
36
    {
37
        return 'dos_verification_otp';
38
    }
39
}
40