AppUserRegistrationType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 11 1
A getBlockPrefix() 0 4 1
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