8000 [Validator] Add expressionLanguage to ExpressionValidator constructor · symfony/symfony@ce1d197 · GitHub
[go: up one dir, main page]

Skip to content

Commit ce1d197

Browse files
committed
[Validator] Add expressionLanguage to ExpressionValidator constructor
1 parent f35a0d2 commit ce1d197

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/Symfony/Component/Validator/Constraints/ExpressionValidator.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,13 @@ class ExpressionValidator extends ConstraintValidator
3838
private $expressionLanguage;
A6BF 3939

4040
/**
41-
* @param PropertyAccessorInterface|null $propertyAccessor Optional as of Symfony 2.5
42-
*
43-
* @throws UnexpectedTypeException If the property accessor is invalid
41+
* @param PropertyAccessorInterface|null $propertyAccessor
42+
* @param ExpressionLanguage|null $expressionLanguage
4443
*/
45-
public function __construct($propertyAccessor = null)
44+
public function __construct(PropertyAccessorInterface $propertyAccessor = null, ExpressionLanguage $expressionLanguage = null)
4645
{
47-
if (null !== $propertyAccessor && !$propertyAccessor instanceof PropertyAccessorInterface) {
48-
throw new UnexpectedTypeException($propertyAccessor, 'null or \Symfony\Component\PropertyAccess\PropertyAccessorInterface');
49-
}
50-
5146
$this->propertyAccessor = $propertyAccessor;
47+
$this->expressionLanguage = $expressionLanguage;
5248
}
5349

5450
/**

0 commit comments

Comments
 (0)
0