ProjectType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 13 1
A getName() 0 4 1
A setDefaultOptions() 0 6 1
1
<?php
2
3
namespace PRReviewWatcher\Form\Type;
4
5
use Symfony\Component\Form\AbstractType;
6
use Symfony\Component\Form\FormBuilderInterface;
7
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
8
9
class ProjectType extends AbstractType
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function buildForm(FormBuilderInterface $builder, array $options)
15
    {
16
        $builder
17
            ->add('name', 'text')
18
            ->add('branch', 'text')
19
            ->add('credential', 'choice', array(
20
                'choices' => $options['credentialChoices'],
21
            ))
22
            ->add('comment', 'textarea')
23
            ->add('alive', 'checkbox', array(
24
                'required' => false,
25
            ));
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function getName()
32
    {
33
        return 'project';
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function setDefaultOptions(OptionsResolverInterface $resolver)
40
    {
41
        $resolver->setRequired(['credentialChoices']);
42
43
        $resolver->setDefaults(['credentialChoices' => array()]);
44
    }
45
}
46