File tree 1 file changed +7
-2
lines changed
src/Symfony/Component/Validator/Constraints
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -38,17 +38,22 @@ class ExpressionValidator extends ConstraintValidator
38
38
private $ expressionLanguage ;
39
39
40
40
/**
41
- * @param PropertyAccessorInterface|null $propertyAccessor Optional as of Symfony 2.5
41
+ * @param PropertyAccessorInterface|null $propertyAccessor Optional as of Symfony 2.5
42
+ * @param ExpressionLanguage $expressionLanguage
42
43
*
43
44
* @throws UnexpectedTypeException If the property accessor is invalid
44
45
*/
45
- public function __construct ($ propertyAccessor = null )
46
+ public function __construct ($ propertyAccessor = null , $ expressionLanguage = null )
46
47
{
47
48
if (null !== $ propertyAccessor && !$ propertyAccessor instanceof PropertyAccessorInterface) {
48
49
throw new UnexpectedTypeException ($ propertyAccessor , 'null or \Symfony\Component\PropertyAccess\PropertyAccessorInterface ' );
49
50
}
51
+ if (null !== $ expressionLanguage && !$ expressionLanguage instanceof ExpressionLanguage) {
52
+ throw new UnexpectedTypeException ($ expressionLanguage , 'null or \Symfony\Component\ExpressionLanguage\ExpressionLanguage ' );
53
+ }
50
54
51
55
$ this ->propertyAccessor = $ propertyAccessor ;
56
+ $ this ->expressionLanguage = $ expressionLanguage ;
52
57
}
53
58
54
59
/**
You can’t perform that action at this time.
0 commit comments