TranslationMessageType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 13 1
A configureOptions() 0 6 1
A getName() 0 4 1
1
<?php
2
3
namespace Sleepness\UberTranslationAdminBundle\Form\Type;
4
5
use Symfony\Component\Form\AbstractType;
6
use Symfony\Component\Form\FormBuilderInterface;
7
use Symfony\Component\OptionsResolver\OptionsResolver;
8
9
/**
10
 * Class for form edit message translation
11
 *
12
 * @author Viktor Novikov <[email protected]>
13
 */
14
class TranslationMessageType extends AbstractType
15
{
16
    /**
17
     * {@inheritDoc}
18
     */
19
    public function buildForm(FormBuilderInterface $builder, array $options)
20
    {
21
        $builder
22
            ->add('locale', 'text')
23
            ->add('domain', 'text')
24
            ->add('key', 'text')
25
            ->add('translation', 'textarea', array(
26
                'attr'  => array(
27
                    'rows' => 4,
28
                    'cols' => 45,
29
                )
30
            ));
31
    }
32
33
    /**
34
     * {@inheritDoc}
35
     */
36
    public function configureOptions(OptionsResolver $resolver)
37
    {
38
        $resolver->setDefaults(array(
39
            'data_class' => 'Sleepness\UberTranslationAdminBundle\Form\Model\TranslationModel',
40
        ));
41
    }
42
43
    /**
44
     * {@inheritDoc}
45
     */
46
    public function getName()
47
    {
48
        return 'translation_form';
49
    }
50
} 
51