CustomerRegistrationType   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 17 1
A getParent() 0 4 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\Customer;
13
14
use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType;
15
use Symfony\Component\Form\Extension\Core\Type\TextType;
16
use Symfony\Component\Form\FormBuilderInterface;
17
18
final class CustomerRegistrationType extends AbstractResourceType
19
{
20
    /**
21
     * {@inheritdoc}
22
     */
23
    public function buildForm(FormBuilderInterface $builder, array $options = [])
24
    {
25
        parent::buildForm($builder, $options);
26
27
        $builder
28
            ->add('firstName', TextType::class, [
29
                'label' => 'sylius.form.customer.first_name',
30
            ])
31
            ->add('lastName', TextType::class, [
32
                'label' => 'sylius.form.customer.last_name',
33
            ])
34
            ->add('phoneNumber', TextType::class, [
35
                'required' => false,
36
                'label' => 'sylius.form.customer.phone_number',
37
            ])
38
        ;
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
44
    public function getParent()
45
    {
46
        return CustomerSimpleRegistrationType::class;
47
    }
48
49
    /**
50
     * {@inheritdoc}
51
     */
52
    public function getBlockPrefix()
53
    {
54
        return 'sylius_customer_registration';
55
    }
56
}
57