EventType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 10 1
A getBlockPrefix() 0 4 1
A configureOptions() 0 7 1
1
<?php
2
3
namespace AppBundle\Form;
4
5
use AppBundle\Entity\DTO\DtoEvent;
6
use Symfony\Component\Form\AbstractType;
7
use Symfony\Component\Form\FormBuilderInterface;
8
use Symfony\Component\OptionsResolver\OptionsResolver;
9
10
class EventType 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
    public function buildForm(FormBuilderInterface $builder, array $options)
20
    {
21
        $builder
22
            ->add('user')
23
            ->add('summary')
24
            ->add('description')
25
            ->add('location')
26
            ->add('start')
27
            ->add('end');
28
    }
29
30
    public function getBlockPrefix()
31
    {
32
        return 'event';
33
    }
34
35
    public function configureOptions(OptionsResolver $resolver)
36
    {
37
        $resolver
38
            ->setDefaults([
39
                'data_class' => DtoEvent::class,
40
            ]);
41
    }
42
}
43