GameType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 29
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 13 1
A configureOptions() 0 7 1
A getBlockPrefix() 0 4 1
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