add( 'domain', TextType::class, [ 'label' => 'Domain', 'required' => true, 'help' => 'Regular expression: do not add the delimiter', 'attr' => [ ], 'constraints' => [ new NotBlank(), new Length(max: 255), ], ] ); $builder->add( 'type', ChoiceType::class, [ 'label' => 'Type', 'required' => true, 'choices' => [ 'Domain' => 'domain', 'Regular expression' => 'regexp', ], 'attr' => [ ], 'constraints' => [ new NotBlank(), ], ] ); } public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ ]); } }