Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
38 / 38 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
ParticipantType | |
100.00% |
38 / 38 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
buildForm | |
100.00% |
31 / 31 |
|
100.00% |
1 / 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\Participant; |
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 ParticipantType extends AbstractType |
13 | { |
14 | public function buildForm(FormBuilderInterface $builder, array $options) |
15 | { |
16 | $builder |
17 | ->add('prenom', TextType::class, [ |
18 | 'label' => 'global.label.contact.first_name', |
19 | 'required' => true, |
20 | 'attr' => [ |
21 | 'maxlength' => 255, |
22 | ], |
23 | 'purify_html' => true, |
24 | ]) |
25 | ->add('nomDeFamille', TextType::class, [ |
26 | 'label' => 'global.label.contact.last_name', |
27 | 'required' => true, |
28 | 'attr' => [ |
29 | 'maxlength' => 255, |
30 | ], |
31 | 'purify_html' => true, |
32 | ]) |
33 | ->add('civilite', DictionaryType::class, [ |
34 | 'label' => 'global.label.contact.civility', |
35 | 'required' => true, |
36 | 'name' => 'user_contact_civility', |
37 | ]) |
38 | ->add('fonction', TextType::class, [ |
39 | 'label' => 'global.label.contact.job', |
40 | 'required' => true, |
41 | 'attr' => [ |
42 | 'maxlength' => 255, |
43 | ], |
44 | 'purify_html' => true, |
45 | ]) |
46 | ; |
47 | } |
48 | |
49 | /** |
50 | * Provide type options. |
51 | */ |
52 | public function configureOptions(OptionsResolver $resolver) |
53 | { |
54 | $resolver |
55 | ->setDefaults([ |
56 | 'data_class' => Participant::class, |
57 | 'validation_groups' => [ |
58 | 'default', |
59 | ], |
60 | ]); |
61 | } |
62 | } |