EventType::configureOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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