Registration   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
dl 0
loc 56
ccs 25
cts 25
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A buildForm() 0 48 1
1
<?php
2
/* Copyright (C) 2018 Michael Giesler
3
 *
4
 * This file is part of Dembelo.
5
 *
6
 * Dembelo is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU Affero General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * Dembelo is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
 * GNU Affero General Public License 3 for more details.
15
 *
16
 * You should have received a copy of the GNU Affero General Public License 3
17
 * along with Dembelo. If not, see <http://www.gnu.org/licenses/>.
18
 */
19
20
namespace DembeloMain\Form;
21
22
use Symfony\Component\Form\AbstractType;
23
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
24
use Symfony\Component\Form\Extension\Core\Type\EmailType;
25
use Symfony\Component\Form\Extension\Core\Type\PasswordType;
26
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
27
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
28
use Symfony\Component\Form\Extension\Core\Type\TextType;
29
use Symfony\Component\Form\FormBuilderInterface;
30
31
/**
32
 * Class Registration
33
 */
34
class Registration extends AbstractType
35
{
36
    /**
37
     * @param FormBuilderInterface $builder
38
     * @param array                $options
39
     *
40
     * @return void
41
     */
42 1
    public function buildForm(FormBuilderInterface $builder, array $options)
43
    {
44
        $builder
45 1
            ->add(
46 1
                'email',
47 1
                EmailType::class,
48 1
                ['label' => false, 'attr' => ['class' => 'u-full-width', 'placeholder' => 'Email']]
49
            )
50 1
            ->add(
51 1
                'password',
52 1
                PasswordType::class,
53 1
                ['label' => false, 'attr' => ['class' => 'u-full-width', 'placeholder' => 'Password']]
54
            )
55 1
            ->add(
56 1
                'gender',
57 1
                ChoiceType::class,
58
                [
59 1
                    'choices' => ['male' => 'm', 'female' => 'f'],
60
                    'label' => false,
61
                    'placeholder' => 'Gender',
62
                    'required' => false,
63
                    'attr' => ['class' => 'u-full-width'],
64
                ]
65
            )
66 1
            ->add(
67 1
                'source',
68 1
                TextType::class,
69
                [
70 1
                    'label' => 'Where have you first heard of Dembelo?',
71
                    'required' => false,
72
                    'attr' => ['class' => 'u-full-width'],
73
                ]
74
            )
75 1
            ->add(
76 1
                'reason',
77 1
                TextareaType::class,
78
                [
79 1
                    'label' => 'Why to you want to participate in our Closed Beta?',
80
                    'required' => false,
81
                    'attr' => ['class' => 'u-full-width'],
82
                ]
83
            )
84 1
            ->add(
85 1
                'save',
86 1
                SubmitType::class,
87
                [
88 1
                    'label' => 'Request registration',
89
                    'attr' => ['class' => 'button button-primary u-full-width'],
90
                ]
91
            );
92 1
    }
93
}
94