CredentialType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 9 1
A getName() 0 4 1
A setDefaultOptions() 0 5 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 CredentialType extends AbstractType
10
{
11
    /**
12
     * {@inheritdoc}
13
     */
14
    public function buildForm(FormBuilderInterface $builder, array $options)
15
    {
16
        $builder
17
            ->add('nameCred', 'text')
18
            ->add('token', 'text', array(
19
                'mapped' => $options['mapped'],
20
                'disabled' => $options['disable']
21
            ));
22
    }
23
24
    /**
25
     * {@inheritdoc}
26
     */
27
    public function getName()
28
    {
29
        return 'credential';
30
    }
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function setDefaultOptions(OptionsResolverInterface $resolver)
36
    {
37
        $resolver->setRequired(['mapped']);
38
        $resolver->setRequired(['disable']);
39
    }
40
}
41