Passed
Push — master ( e91424...06fcec )
by Martin
06:44
created

UpdateTaskForm   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 12 1
1
<?php
2
/**
3
 * File: UpdateTaskForm.php - todo
4
 * zzz - 04/02/17 17:46
5
 * PHP Version 7
6
 *
7
 * @category None
8
 * @package  Todo
9
 * @author   Martin Pham <[email protected]>
10
 * @license  None http://
11
 * @link     None
12
 */
13
14
namespace Web\FrontendBundle\Form;
15
16
use Symfony\Component\Form\AbstractType;
17
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
18
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
19
use Symfony\Component\Form\FormBuilderInterface;
20
use Todo\Domain\Task;
21
22
/**
23
 * Class UpdateTaskForm
24
 *
25
 * @category None
26
 * @package  Web\FrontendBundle\Form
27
 * @author   Martin Pham <[email protected]>
28
 * @license  None http://
29
 * @link     None
30
 */
31
class UpdateTaskForm extends AbstractType
32
{
33
    /**
34
     * Build Form
35
     *
36
     * @param FormBuilderInterface $builder Form builder
37
     * @param array                $options Options
38
     *
39
     * @return void
40
     */
41
    public function buildForm(FormBuilderInterface $builder, array $options)
42
    {
43
        $builder
44
            ->add('name')
45
            ->add('status', ChoiceType::class, [
46
                'choices' => [
47
                    Task::STATUS_REMAINING => Task::STATUS_REMAINING,
48
                    Task::STATUS_COMPLETED => Task::STATUS_COMPLETED
49
                ]
50
            ])
51
            ->add('submit', SubmitType::class);
52
    }
53
}
54