Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 52
0.00% covered (danger)
0.00%
0 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
MesureProtectionAIPDType
0.00% covered (danger)
0.00%
0 / 52
0.00% covered (danger)
0.00%
0 / 2
6
0.00% covered (danger)
0.00%
0 / 1
 buildForm
0.00% covered (danger)
0.00%
0 / 49
0.00% covered (danger)
0.00%
0 / 1
2
 configureOptions
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3declare(strict_types=1);
4
5namespace App\Domain\AIPD\Form\Type;
6
7use App\Domain\AIPD\Model\AbstractMesureProtection;
8use Symfony\Component\Form\AbstractType;
9use Symfony\Component\Form\Extension\Core\Type\IntegerType;
10use Symfony\Component\Form\Extension\Core\Type\TextType;
11use Symfony\Component\Form\FormBuilderInterface;
12use Symfony\Component\OptionsResolver\OptionsResolver;
13
14class MesureProtectionAIPDType extends AbstractType
15{
16    public function buildForm(FormBuilderInterface $builder, array $options)
17    {
18        $builder
19            ->add('nom', TextType::class, [
20                'label' => 'aipd.mesure_protection.label.name',
21                'attr'  => [
22                    'maxlength' => 255,
23                ],
24                'purify_html' => true,
25            ])
26            ->add('nomCourt', TextType::class, [
27                'label' => 'aipd.mesure_protection.label.short_name',
28                'attr'  => [
29                    'maxlength' => 255,
30                ],
31                'purify_html' => true,
32            ])
33            ->add('labelLivrable', TextType::class, [
34                'label' => 'aipd.mesure_protection.label.label_livrable',
35                'attr'  => [
36                    'maxlength' => 255,
37                ],
38                'purify_html' => true,
39            ])
40            ->add('phrasePreconisation', TextType::class, [
41                'label' => 'aipd.mesure_protection.label.preconisation',
42                'attr'  => [
43                    'maxlength' => 255,
44                ],
45                'purify_html' => true,
46            ])
47            ->add('detail', TextType::class, [
48                'label' => 'aipd.mesure_protection.label.detail',
49                'attr'  => [
50                    'maxlength' => 255,
51                ],
52                'purify_html' => true,
53            ])
54            ->add('poidsVraisemblance', IntegerType::class, [
55                'label' => 'aipd.mesure_protection.label.vraisemblance',
56                'attr'  => [
57                    'min' => 1,
58                ],
59            ])
60            ->add('poidsGravite', IntegerType::class, [
61                'label' => 'aipd.mesure_protection.label.gravite',
62                'attr'  => [
63                    'min' => 1,
64                ],
65            ])
66        ;
67    }
68
69    public function configureOptions(OptionsResolver $resolver)
70    {
71        $resolver->setDefaults([
72            'data_class' => AbstractMesureProtection::class,
73        ]);
74    }
75}