OptionType::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 1 Features 0
Metric Value
c 3
b 1
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Padam87\AttributeBundle\Form;
4
5
use Symfony\Component\Form\AbstractType;
6
use Symfony\Component\Form\FormBuilderInterface;
7
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
8
9
class OptionType extends AbstractType
10
{
11
    public function buildForm(FormBuilderInterface $builder, array $options)
12
    {
13
        $builder
14
            ->add('name')
15
            ->add('value')
16
        ;
17
    }
18
19
    public function getName()
20
    {
21
        return 'attribute_option';
22
    }
23
24
    public function setDefaultOptions(OptionsResolverInterface $resolver)
25
    {
26
        $resolver->setDefaults([
27
            'data_class' => 'Padam87\AttributeBundle\Entity\Option',
28
        ]);
29
    }
30
}
31