YamlType::getName()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace DoS\ResourceBundle\Form\Type;
4
5
use DoS\ResourceBundle\Form\DataTransformer\YamlTransformer;
6
use Symfony\Component\Form\AbstractType;
7
use Symfony\Component\Form\FormBuilderInterface;
8
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
9
10
class YamlType extends AbstractType
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function buildForm(FormBuilderInterface $builder, array $options)
16
    {
17
        $builder
18
            ->addModelTransformer(new YamlTransformer($options['inline_level']))
19
        ;
20
    }
21
22
    /**
23
     * {@inheritdoc}
24
     */
25
    public function setDefaultOptions(OptionsResolverInterface $resolver)
26
    {
27
        parent::setDefaultOptions($resolver);
28
29
        $resolver->setDefaults(array(
30
            'inline_level' => 10,
31
        ));
32
    }
33
34
    /**
35
     * {@inheritdoc}
36
     */
37
    public function getParent()
38
    {
39
        return 'textarea';
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    public function getName()
46
    {
47
        return 'dos_yaml';
48
    }
49
}
50