RegistrationType::getBlockPrefix()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

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