class FormTypeValidatorExtension extends BaseValidatorExtension
{ private ValidatorInterface
$validator;
private ViolationMapper
$violationMapper;
private bool
$legacyErrorMessages;
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
*/