OtpVerificationType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 3
c 2
b 0
f 0
lcom 1
cbo 3
dl 0
loc 30
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getName() 0 4 1
A buildForm() 0 9 1
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