You are here

public function ExpressionValidator::__construct in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Constraints/ExpressionValidator.php \Symfony\Component\Validator\Constraints\ExpressionValidator::__construct()

Parameters

PropertyAccessorInterface|null $propertyAccessor Optional as of Symfony 2.5:

Throws

UnexpectedTypeException If the property accessor is invalid

File

vendor/symfony/validator/Constraints/ExpressionValidator.php, line 45

Class

ExpressionValidator
@author Fabien Potencier <fabien@symfony.com> @author Bernhard Schussek <bschussek@symfony.com>

Namespace

Symfony\Component\Validator\Constraints

Code

public function __construct($propertyAccessor = null) {
  if (null !== $propertyAccessor && !$propertyAccessor instanceof PropertyAccessorInterface) {
    throw new UnexpectedTypeException($propertyAccessor, 'null or \\Symfony\\Component\\PropertyAccess\\PropertyAccessorInterface');
  }
  $this->propertyAccessor = $propertyAccessor;
}