Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
96.43% |
27 / 28 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
ReponseType | |
96.43% |
27 / 28 |
|
50.00% |
1 / 2 |
2 | |
0.00% |
0 / 1 |
buildForm | |
95.24% |
20 / 21 |
|
0.00% |
0 / 1 |
1 | |||
configureOptions | |
100.00% |
7 / 7 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace App\Domain\Registry\Form\Type\ConformiteOrganisation; |
4 | |
5 | use App\Domain\Registry\Model\ConformiteOrganisation\Reponse; |
6 | use Knp\DictionaryBundle\Form\Type\DictionaryType; |
7 | use Symfony\Component\Form\AbstractType; |
8 | use Symfony\Component\Form\Extension\Core\Type\TextType; |
9 | use Symfony\Component\Form\FormBuilderInterface; |
10 | use Symfony\Component\OptionsResolver\OptionsResolver; |
11 | |
12 | class ReponseType extends AbstractType |
13 | { |
14 | /** |
15 | * Build type form. |
16 | */ |
17 | public function buildForm(FormBuilderInterface $builder, array $options) |
18 | { |
19 | $builder |
20 | ->add('reponse', DictionaryType::class, [ |
21 | 'label' => false, |
22 | 'name' => 'registry_conformite_organisation_reponse', |
23 | 'expanded' => true, |
24 | 'required' => true, |
25 | 'placeholder' => false, |
26 | 'choice_attr' => function () { |
27 | return ['required' => 'required']; |
28 | }, |
29 | ]) |
30 | ->add('reponseRaison', TextType::class, [ |
31 | 'label' => false, |
32 | 'required' => false, |
33 | 'attr' => [ |
34 | 'placeholder' => 'global.placeholder.precision', |
35 | 'maxlength' => 255, |
36 | ], |
37 | 'purify_html' => true, |
38 | ]) |
39 | ; |
40 | } |
41 | |
42 | /** |
43 | * Provide type options. |
44 | */ |
45 | public function configureOptions(OptionsResolver $resolver) |
46 | { |
47 | $resolver |
48 | ->setDefaults([ |
49 | 'data_class' => Reponse::class, |
50 | 'validation_groups' => [ |
51 | 'default', |
52 | ], |
53 | ]); |
54 | } |
55 | } |