10000 minor #36428 [Form] Removed legacy check in `ValidationListener` (Hea… · symfony/symfony@db733da · GitHub
[go: up one dir, main page]

Skip to content

Commit db733da

Browse files
committed
minor #36428 [Form] Removed legacy check in ValidationListener (HeahDude)
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`
2 parents 5182253 + e479e51 commit db733da

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Symfony/Component/Form/Extension/Validator/EventListener/ValidationListener.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ public function validateForm(FormEvent $event)
5555
foreach ($this->validator->validate($form) as $violation) {
5656
// Allow the "invalid" constraint to be put onto
5757
// non-synchronized forms
58-
// ConstraintViolation::getConstraint() must not expect to provide a constraint as long as Symfony\Component\Validator\ExecutionContext exists (before 3.0)
59-
$allowNonSynchronized = (null === $violation->getConstraint() || $violation->getConstraint() instanceof Form) && Form::NOT_SYNCHRONIZED_ERROR === $violation->getCode();
58+
$allowNonSynchronized = $violation->getConstraint() instanceof Form && Form::NOT_SYNCHRONIZED_ERROR === $violation->getCode();
6059

6160
$this->violationMapper->mapViolation($violation, $form, $allowNonSynchronized);
6261
}

0 commit comments

Comments
 (0)
0