public function __construct(ValidatorInterface
$validator, bool
$legacyErrorMessages = true, FormRendererInterface
$formRenderer = null, TranslatorInterface
$translator = null
) { $this->validator =
$validator;
$this->violationMapper =
new ViolationMapper($formRenderer,
$translator);
} /**
* @return void
*/
public function buildForm(FormBuilderInterface
$builder, array
$options) { $builder->
addEventSubscriber(new ValidationListener($this->validator,
$this->violationMapper
));
} /**
* @return void
*/
public function configureOptions(OptionsResolver
$resolver) { parent::
configureOptions($resolver);
// Constraint should always be converted to an array
$constraintsNormalizer =
static fn (Options
$options,
$constraints) => \
is_object($constraints) ?
[$constraints] :
(array) $constraints;