Skip to content

Commit b3deb5b

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

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

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

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,10 @@ class ExpressionValidator extends ConstraintValidator
3737
*/
3838
private $expressionLanguage;
3939

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

5446
/**

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