Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 20 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
AnalyseMesureProtectionType | |
0.00% |
0 / 20 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
buildForm | |
0.00% |
0 / 16 |
|
0.00% |
0 / 1 |
2 | |||
configureOptions | |
0.00% |
0 / 4 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace App\Domain\AIPD\Form\Type; |
4 | |
5 | use App\Domain\AIPD\Model\AbstractMesureProtection; |
6 | use Symfony\Component\Form\AbstractType; |
7 | use Symfony\Component\Form\Extension\Core\Type\TextareaType; |
8 | use Symfony\Component\Form\FormBuilderInterface; |
9 | use Symfony\Component\OptionsResolver\OptionsResolver; |
10 | |
11 | class AnalyseMesureProtectionType extends AbstractType |
12 | { |
13 | public function buildForm(FormBuilderInterface $builder, array $options) |
14 | { |
15 | $builder |
16 | ->add('reponse', ReponseDictionaryType::class, [ |
17 | 'aipd' => $options['aipd'], |
18 | 'expanded' => false, |
19 | 'placeholder' => 'Pas de réponse', |
20 | ]) |
21 | ->add('detail', TextareaType::class, [ |
22 | 'required' => true, |
23 | 'attr' => [ |
24 | 'maxlength' => 1000, |
25 | 'rows' => 1, |
26 | 'class' => 'textareaheight', |
27 | ], |
28 | 'purify_html' => true, |
29 | ]) |
30 | ; |
31 | } |
32 | |
33 | public function configureOptions(OptionsResolver $resolver) |
34 | { |
35 | $resolver->setRequired('aipd'); |
36 | |
37 | $resolver->setDefaults([ |
38 | 'data_class' => AbstractMesureProtection::class, |
39 | ]); |
40 | } |
41 | } |