PayeeInfoType   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 78
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 42
dl 0
loc 78
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configureOptions() 0 3 1
A buildForm() 0 60 1
1
<?php
2
/*
3
 * Copyright (C) 2020  Jan Böhmer
4
 *
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU Affero General Public License as published
7
 * by the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU Affero General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU Affero General Public License
16
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
17
 */
18
19
namespace App\Form;
20
21
use App\Entity\Embeddable\PayeeInfo;
22
use Symfony\Component\Form\AbstractType;
23
use Symfony\Component\Form\Extension\Core\Type\TextType;
24
use Symfony\Component\Form\FormBuilderInterface;
25
use Symfony\Component\OptionsResolver\OptionsResolver;
26
27
class PayeeInfoType extends AbstractType
28
{
29
    public function buildForm(FormBuilderInterface $builder, array $options)
30
    {
31
        $builder->add('account_owner', TextType::class, [
32
            'label' => 'bank_info.account_owner.label',
33
            'empty_data' => '',
34
            'attr' => [
35
                'placeholder' => 'bank_info.account_owner.placeholder',
36
                'autocomplete' => 'off',
37
            ],
38
        ]);
39
40
        $builder->add('street', TextType::class, [
41
            'label' => 'bank_info.street.label',
42
            'empty_data' => '',
43
            'attr' => [
44
                'placeholder' => 'bank_info.street.placeholder',
45
                'autocomplete' => 'off',
46
            ],
47
        ]);
48
49
        $builder->add('zip_code', TextType::class, [
50
            'label' => 'bank_info.zip_code.label',
51
            'empty_data' => '',
52
            'attr' => [
53
                'placeholder' => 'bank_info.zip_code.placeholder',
54
                'autocomplete' => 'off',
55
            ],
56
        ]);
57
58
        $builder->add('city', TextType::class, [
59
            'label' => 'bank_info.city.label',
60
            'empty_data' => '',
61
            'attr' => [
62
                'placeholder' => 'bank_info.city.placeholder',
63
                'autocomplete' => 'off',
64
            ],
65
        ]);
66
67
        $builder->add('iban', TextType::class, [
68
            'label' => 'bank_info.iban.label',
69
            'empty_data' => '',
70
            'attr' => [
71
                'placeholder' => 'bank_info.iban.placeholder',
72
            ],
73
        ]);
74
75
        $builder->add('bic', TextType::class, [
76
            'label' => 'bank_info.bic.label',
77
            'required' => false,
78
            'empty_data' => '',
79
            'attr' => [
80
                'placeholder' => 'bank_info.bic.placeholder',
81
            ],
82
        ]);
83
84
        $builder->add('bank_name', TextType::class, [
85
            'label' => 'bank_info.bank_name.label',
86
            'empty_data' => '',
87
            'attr' => [
88
                'placeholder' => 'bank_info.bank_name.placeholder',
89
            ],
90
        ]);
91
92
        /*$builder->add('reference', TextType::class, [
93
            'label' => 'bank_info.reference.label',
94
            'required' => false,
95
            'empty_data' => '',
96
            'attr' => [
97
                'placeholder' => 'bank_info.reference.placeholder'
98
            ]
99
        ]);*/
100
    }
101
102
    public function configureOptions(OptionsResolver $resolver)
103
    {
104
        $resolver->setDefault('data_class', PayeeInfo::class);
105
    }
106
}
107