RegistrationType   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 5
dl 0
loc 28
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A getBlockPrefix() 0 3 1
A getParent() 0 3 1
A configureOptions() 0 5 1
A buildForm() 0 4 1
A getName() 0 3 1
1
<?php
2
3
namespace AppUserBundle\Form;
4
5
use Symfony\Component\Form\AbstractType;
6
use Symfony\Component\Form\FormBuilderInterface;
7
use Symfony\Component\OptionsResolver\OptionsResolver;
8
9
class RegistrationType extends AbstractType
10
{
11
    public function buildForm(FormBuilderInterface $builder, array $options)
12
    {
13
        $builder->add('firstName', null, ['label' => 'first_name']);
14
        $builder->add('lastName', null, ['label' => 'last_name']);
15
    }
16
17
    public function getParent()
18
    {
19
        return 'FOS\UserBundle\Form\Type\RegistrationFormType';
20
    }
21
22
    public function getBlockPrefix()
23
    {
24
        return 'app_user_registration';
25
    }
26
27
    public function getName()
28
    {
29
        return $this->getBlockPrefix();
30
    }
31
32
    public function configureOptions(OptionsResolver $resolver)
33
    {
34
        parent::configureOptions($resolver);
35
        $resolver->setDefaults(array(
36
            'translation_domain' => 'user',
37
        ));
38
    }
39
}
40