LoginType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 28
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 6 1
A getBlockPrefix() 0 4 1
A configureOptions() 0 6 1
1
<?php
2
3
namespace AppBundle\Form;
4
5
use AppBundle\Entity\DTO\DtoUser;
6
use Symfony\Component\Form\AbstractType;
7
use Symfony\Component\Form\FormBuilderInterface;
8
use Symfony\Component\OptionsResolver\OptionsResolver;
9
10
class LoginType extends AbstractType
11
{
12
    /**
13
     * @param FormBuilderInterface $builder
14
     * @param array                $options
15
     * @SuppressWarnings("UnusedFormalParameter")
16
     * After add new field in UserType need create
17
     * offsetUnset() method from this field in Security controller
18
     */
19 1
    public function buildForm(FormBuilderInterface $builder, array $options)
20
    {
21
        $builder
22 1
            ->add('email')
23 1
            ->add('password');
24 1
    }
25
26 1
    public function getBlockPrefix()
27
    {
28 1
        return 'user';
29
    }
30
31 1
    public function configureOptions(OptionsResolver $resolver)
32
    {
33 1
        $resolver->setDefaults([
34 1
            'data_class' => DtoUser::class,
35
        ]);
36 1
    }
37
}
38