CredentialType::setDefaultOptions()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 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