Skip to content

Commit 1828d06

Browse files
committed
bug symfony#16251 Fix the detection of the deprecated usage of the ValidationListener (stof)
This PR was merged into the 2.8 branch. Discussion ---------- Fix the detection of the deprecated usage of the ValidationListener | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | symfony#16248 | License | MIT | Doc PR | n/a the deprecation trigger should be triggered only when the valdiator does not implement the new interface. but implementing both the old and new interface is fine (and this is what is done in Symfony by default, as we provide a BC layer) Commits ------- de04070 Fix the detection of the deprecated usage of the ValidationListener
2 parents eca3e37 + de04070 commit 1828d06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct($validator, ViolationMapperInterface $violationMappe
4646
throw new \InvalidArgumentException('Validator must be instance of Symfony\Component\Validator\Validator\ValidatorInterface or Symfony\Component\Validator\ValidatorInterface');
4747
}
4848

49-
if ($validator instanceof LegacyValidatorInterface) {
49+
if (!$validator instanceof ValidatorInterface) {
5050
@trigger_error('Passing an instance of Symfony\Component\Validator\ValidatorInterface as argument to the '.__METHOD__.' method is deprecated since version 2.8 and will be removed in 3.0. Use an implementation of Symfony\Component\Validator\Validator\ValidatorInterface instead', E_USER_DEPRECATED);
5151
}
5252

0 commit comments

Comments
 (0)