AppUserRegistrationType::getBlockPrefix()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
nc 1
cc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of AppName.
5
 *
6
 * (c) Monofony
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace App\Form\Type\User;
13
14
use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType;
15
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
16
use Symfony\Component\Form\Extension\Core\Type\RepeatedType;
17
use Symfony\Component\Form\FormBuilderInterface;
18
19
final class AppUserRegistrationType extends AbstractResourceType
20
{
21
    /**
22
     * {@inheritdoc}
23
     */
24
    public function buildForm(FormBuilderInterface $builder, array $options)
25
    {
26
        $builder
27
            ->add('plainPassword', RepeatedType::class, [
28
                'type' => PasswordType::class,
29
                'first_options' => ['label' => 'sylius.form.user.password.label'],
30
                'second_options' => ['label' => 'sylius.form.user.password.confirmation'],
31
                'invalid_message' => 'sylius.user.plainPassword.mismatch',
32
            ])
33
        ;
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public function getBlockPrefix()
40
    {
41
        return 'sylius_app_user_registration';
42
    }
43
}
44