Skip to content

Commit

Permalink
minor #36428 [Form] Removed legacy check in ValidationListener (Hea…
Browse files Browse the repository at this point in the history
…hDude)

This PR was merged into the 3.4 branch.

Discussion
----------

[Form] Removed legacy check in `ValidationListener`

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       | ~
| License       | MIT
| Doc PR        | ~

A left over of #13198, should have been removed in 3.0. The tests don't use `null` anymore, no update needed here, this is just about removing dead code.

Commits
-------

e479e51 [Form] Removed legacy check in `ValidationListener`
  • Loading branch information
fabpot committed Apr 12, 2020
2 parents 5182253 + e479e51 commit db733da
Showing 1 changed file with 1 addition and 2 deletions.
Expand Up @@ -55,8 +55,7 @@ public function validateForm(FormEvent $event)
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);
}
Expand Down

0 comments on commit db733da

Please sign in to comment.