Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 11 |
| CatalogFlowType | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 11 |
| buildForm | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 7 |
|||
| configureOptions | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 4 |
|||
| <?php | |
| declare(strict_types=1); | |
| namespace App\UI\HTTP\REST\FormType; | |
| use Symfony\Component\Form\AbstractType; | |
| use Symfony\Component\Form\Extension\Core\Type\IntegerType; | |
| use Symfony\Component\Form\Extension\Core\Type\TextType; | |
| use Symfony\Component\Form\FormBuilderInterface; | |
| use Symfony\Component\OptionsResolver\OptionsResolver; | |
| use Symfony\Component\Validator\Constraints\GreaterThan; | |
| use Symfony\Component\Validator\Constraints\NotBlank; | |
| use Symfony\Component\Validator\Constraints\Uuid; | |
| final class CatalogFlowType extends AbstractType | |
| { | |
| public function buildForm(FormBuilderInterface $builder, array $options): void | |
| { | |
| $builder | |
| ->add('uuid', TextType::class, [ | |
| 'constraints' => [ | |
| new NotBlank(), | |
| new Uuid(), | |
| ], | |
| ]) | |
| ->add('version', IntegerType::class, [ | |
| 'constraints' => [ | |
| new NotBlank(), | |
| new GreaterThan(0), | |
| ], | |
| ]) | |
| ; | |
| } | |
| public function configureOptions(OptionsResolver $resolver): void | |
| { | |
| parent::configureOptions($resolver); // TODO: Change the autogenerated stub | |
| $resolver->setDefaults([ | |
| 'allow_extra_fields' => true, | |
| ]); | |
| } | |
| } |