TemplateType   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 4
dl 0
loc 49
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B buildForm() 0 45 1
1
<?php
2
3
namespace Starkerxp\CampaignBundle\Form\Type;
4
5
use Starkerxp\StructureBundle\Form\Type\AbstractType;
6
use Symfony\Component\Form\Extension\Core\Type;
7
use Symfony\Component\Form\FormBuilderInterface;
8
use Symfony\Component\Validator\Constraints;
9
10
class TemplateType extends AbstractType
11
{
12
    public function buildForm(FormBuilderInterface $builder, array $options)
13
    {
14
        $builder
15
            ->add(
16
                'type',
17
                Type\ChoiceType::class,
18
                [
19
                    "choices" => [
20
                        "email",
21
                        "sms",
22
                        "courrier",
23
                    ],
24
                ]
25
            )
26
            ->add(
27
                'name',
28
                Type\TextType::class,
29
                [
30
                    'constraints' => [
31
                        new Constraints\NotBlank(),
32
                        new Constraints\Length(['min' => 3]),
33
                    ],
34
                ]
35
            )
36
            ->add(
37
                'object',
38
                Type\TextType::class,
39
                [
40
                    'constraints' => [
41
                        new Constraints\NotBlank(),
42
                        new Constraints\Length(['min' => 3]),
43
                    ],
44
                ]
45
            )
46
            ->add(
47
                'message',
48
                Type\TextareaType::class,
49
                [
50
                    'constraints' => [
51
                        new Constraints\NotBlank(),
52
                        new Constraints\Length(['min' => 10]),
53
                    ],
54
                ]
55
            );
56
    }
57
58
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
59