[Form] Removed legacy check in `ValidationListener`

This commit is contained in:
Jules Pietri 2020-04-11 20:54:18 +02:00
parent 5da141b8d0
commit e479e51f7c
No known key found for this signature in database
GPG Key ID: C924CC98D39AA885
1 changed files with 1 additions and 2 deletions

View File

@ -55,8 +55,7 @@ class ValidationListener implements EventSubscriberInterface
foreach ($this->validator->validate($form) as $violation) {
// Allow the "invalid" constraint to be put onto
// non-synchronized forms
// ConstraintViolation::getConstraint() must not expect to provide a constraint as long as Symfony\Component\Validator\ExecutionContext exists (before 3.0)
$allowNonSynchronized = (null === $violation->getConstraint() || $violation->getConstraint() instanceof Form) && Form::NOT_SYNCHRONIZED_ERROR === $violation->getCode();
$allowNonSynchronized = $violation->getConstraint() instanceof Form && Form::NOT_SYNCHRONIZED_ERROR === $violation->getCode();
$this->violationMapper->mapViolation($violation, $form, $allowNonSynchronized);
}