File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 44
55use Nette \DI \Container ;
66use Symfony \Component \Validator \Constraint ;
7+ use Symfony \Component \Validator \Constraints \ExpressionValidator ;
78use Symfony \Component \Validator \ConstraintValidatorFactoryInterface ;
89use Symfony \Component \Validator \ConstraintValidatorInterface ;
910use Symfony \Component \Validator \Exception \UnexpectedTypeException ;
@@ -35,7 +36,9 @@ public function __construct(Container $container)
3536 public function getInstance (Constraint $ constraint ): ConstraintValidatorInterface
3637 {
3738 /** @var class-string<ConstraintValidatorInterface> $name */
38- $ name = $ constraint ->validatedBy ();
39+ $ name = $ constraint ->validatedBy () === 'validator.expression '
40+ ? ExpressionValidator::class
41+ : $ constraint ->validatedBy ();
3942
4043 if (!isset ($ this ->validators [$ name ])) {
4144 $ validator = $ this ->container ->getByType ($ name , false );
You can’t perform that action at this time.
0 commit comments