GameType::getBlockPrefix()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace KI\PonthubBundle\Form;
4
5
use KI\CoreBundle\Selector\ImageSelector;
6
use KI\CoreBundle\Selector\TagsSelector;
7
use KI\PonthubBundle\Entity\Game;
8
use KI\PonthubBundle\Selector\GenresSelector;
9
use Symfony\Component\Form\AbstractType;
10
use Symfony\Component\Form\FormBuilderInterface;
11
use Symfony\Component\OptionsResolver\OptionsResolver;
12
13
class GameType extends AbstractType
14
{
15
    public function buildForm(FormBuilderInterface $builder, array $options)
16
    {
17
        $builder
18
            ->add('name')
19
            ->add('description')
20
            ->add('genres', GenresSelector::class)
21
            ->add('tags', TagsSelector::class)
22
            ->add('year')
23
            ->add('studio')
24
            ->add('os')
25
            ->add('image', ImageSelector::class)
26
        ;
27
    }
28
29
    public function configureOptions(OptionsResolver $resolver)
30
    {
31
        $resolver->setDefaults([
32
            'csrf_protection' => false,
33
            'data_class' => Game::class
34
        ]);
35
    }
36
37
    public function getBlockPrefix()
38
    {
39
        return '';
40
    }
41
}
42