Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
57 / 57 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| ContractType | |
100.00% |
57 / 57 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| configureOptions | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 | |||
| buildForm | |
100.00% |
52 / 52 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace App\Form; |
| 6 | |
| 7 | use App\Entity\Contract; |
| 8 | use App\Type\Gender; |
| 9 | use Override; |
| 10 | use Symfony\Component\Form\AbstractType; |
| 11 | use Symfony\Component\Form\Extension\Core\Type\EnumType; |
| 12 | use Symfony\Component\Form\FormBuilderInterface; |
| 13 | use Symfony\Component\OptionsResolver\OptionsResolver; |
| 14 | |
| 15 | class ContractType extends AbstractType |
| 16 | { |
| 17 | #[Override] |
| 18 | public function configureOptions(OptionsResolver $resolver): void |
| 19 | { |
| 20 | $resolver->setDefaults( |
| 21 | [ |
| 22 | 'data_class' => Contract::class, |
| 23 | ] |
| 24 | ); |
| 25 | } |
| 26 | |
| 27 | #[Override] |
| 28 | public function buildForm( |
| 29 | FormBuilderInterface $builder, |
| 30 | array $options |
| 31 | ): void |
| 32 | { |
| 33 | $builder |
| 34 | ->add('date') |
| 35 | // Store |
| 36 | ->add('storeNumber') |
| 37 | ->add('destination', null, [ |
| 38 | 'label' => 'Destino', |
| 39 | ]) |
| 40 | ->add('valAlq', null, [ |
| 41 | 'label' => 'Alquiler', |
| 42 | ]) |
| 43 | ->add('valGarantia') |
| 44 | // User |
| 45 | ->add('gender', EnumType::class, [ |
| 46 | 'class' => Gender::class, |
| 47 | ]) |
| 48 | ->add('inqNombreApellido', null, ['empty_data' => '']) |
| 49 | ->add('inqCi') |
| 50 | // Accesories |
| 51 | ->add('cntLanfort', null, [ |
| 52 | 'label' => 'Lanfort', |
| 53 | ]) |
| 54 | ->add('cntNeon', null, [ |
| 55 | 'label' => 'Neon', |
| 56 | ]) |
| 57 | ->add('cntSwitch', null, [ |
| 58 | 'label' => 'Switch', |
| 59 | ]) |
| 60 | ->add('cntToma', null, [ |
| 61 | 'label' => 'Toma', |
| 62 | ]) |
| 63 | ->add('cntVentana', null, [ |
| 64 | 'label' => 'Ventana', |
| 65 | ]) |
| 66 | ->add('cntLlaves', null, [ |
| 67 | 'label' => 'Llaves', |
| 68 | ]) |
| 69 | ->add('cntMedElec', null, [ |
| 70 | 'label' => 'Medidor', |
| 71 | ]) |
| 72 | ->add('cntMedAgua', null, [ |
| 73 | 'label' => 'Medidor', |
| 74 | ]) |
| 75 | ->add('medElectrico', null, [ |
| 76 | 'label' => 'Electrico', |
| 77 | 'empty_data' => '', |
| 78 | ]) |
| 79 | ->add('medAgua', null, [ |
| 80 | 'label' => 'Agua', |
| 81 | 'empty_data' => '', |
| 82 | ]) |
| 83 | // Text |
| 84 | ->add('text'); |
| 85 | } |
| 86 | } |