Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
28 / 28 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
AnalyseSingleAvisType | |
100.00% |
28 / 28 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
buildForm | |
100.00% |
25 / 25 |
|
100.00% |
1 / 1 |
1 | |||
configureOptions | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace App\Domain\AIPD\Form\Type; |
6 | |
7 | use App\Domain\AIPD\Model\AnalyseAvis; |
8 | use Knp\DictionaryBundle\Form\Type\DictionaryType; |
9 | use Symfony\Component\Form\AbstractType; |
10 | use Symfony\Component\Form\Extension\Core\Type\DateType; |
11 | use Symfony\Component\Form\Extension\Core\Type\TextareaType; |
12 | use Symfony\Component\Form\FormBuilderInterface; |
13 | use Symfony\Component\OptionsResolver\OptionsResolver; |
14 | |
15 | class AnalyseSingleAvisType extends AbstractType |
16 | { |
17 | public function buildForm(FormBuilderInterface $builder, array $options) |
18 | { |
19 | $builder |
20 | ->add('date', DateType::class, [ |
21 | 'required' => true, |
22 | 'label' => false, |
23 | 'widget' => 'single_text', |
24 | 'format' => 'dd/MM/yyyy', |
25 | 'html5' => false, |
26 | 'attr' => [ |
27 | 'class' => 'datepicker', |
28 | ], |
29 | ]) |
30 | ->add('reponse', DictionaryType::class, [ |
31 | 'name' => 'reponse_avis', |
32 | 'required' => true, |
33 | ]) |
34 | ->add('detail', TextareaType::class, [ |
35 | 'required' => true, |
36 | 'attr' => [ |
37 | 'maxlength' => 1000, |
38 | 'rows' => 1, |
39 | 'class' => 'textareaheight', |
40 | ], |
41 | 'purify_html' => true, |
42 | ]) |
43 | ; |
44 | } |
45 | |
46 | public function configureOptions(OptionsResolver $resolver) |
47 | { |
48 | $resolver->setDefaults([ |
49 | 'data_class' => AnalyseAvis::class, |
50 | ]); |
51 | } |
52 | } |