SemesterType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 12
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configureOptions() 0 5 1
A buildForm() 0 3 1
1
<?php
2
3
/*
4
 * This file is part of the thealternativezurich/feedback project.
5
 *
6
 * (c) Florian Moser <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace App\Form\Semester;
13
14
use App\Entity\Semester;
15
use Symfony\Component\Form\AbstractType;
16
use Symfony\Component\Form\Extension\Core\Type\TextType;
17
use Symfony\Component\Form\FormBuilderInterface;
18
use Symfony\Component\OptionsResolver\OptionsResolver;
19
20
class SemesterType extends AbstractType
21
{
22
    public function buildForm(FormBuilderInterface $builder, array $options)
23
    {
24
        $builder->add('name', TextType::class);
25
    }
26
27
    public function configureOptions(OptionsResolver $resolver)
28
    {
29
        $resolver->setDefaults([
30
            'data_class' => Semester::class,
31
            'translation_domain' => 'entity_semester',
32
        ]);
33
    }
34
}
35