EventType::getBlockPrefix()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
rs 10
ccs 0
cts 4
cp 0
cc 1
eloc 2
nc 1
nop 0
crap 2
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