Skip to content

Commit aa9757c

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

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,22 @@ class ExpressionValidator extends ConstraintValidator
3838
private $expressionLanguage;
3939

4040
/**
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|null $expressionLanguage
4243
*
4344
* @throws UnexpectedTypeException If the property accessor is invalid
4445
*/
45-
public function __construct($propertyAccessor = null)
46+
public function __construct($propertyAccessor = null, $expressionLanguage = null)
4647
{
4748
if (null !== $propertyAccessor && !$propertyAccessor instanceof PropertyAccessorInterface) {
4849
throw new UnexpectedTypeException($propertyAccessor, 'null or \Symfony\Component\PropertyAccess\PropertyAccessorInterface');
4950
}
51+
if (null !== $expressionLanguage && !$expressionLanguage instanceof ExpressionLanguage) {
52+
throw new UnexpectedTypeException($expressionLanguage, 'null or \Symfony\Component\ExpressionLanguage\ExpressionLanguage');
53+
}
5054

5155
$this->propertyAccessor = $propertyAccessor;
56+
$this->expressionLanguage = $expressionLanguage;
5257
}
5358

5459
/**

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy