You are here

protected function ConstraintValidator::buildViolation in Zircon Profile 8

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

Wrapper for {@link ExecutionContextInterface::buildViolation} that supports the 2.4 context API.

Parameters

string $message The violation message:

array $parameters The message parameters:

Return value

ConstraintViolationBuilderInterface The violation builder

Deprecated

since version 2.5, to be removed in 3.0.

File

vendor/symfony/validator/ConstraintValidator.php, line 64

Class

ConstraintValidator
Base class for constraint validators.

Namespace

Symfony\Component\Validator

Code

protected function buildViolation($message, array $parameters = array()) {
  @trigger_error('The ' . __METHOD__ . ' is deprecated since version 2.5 and will be removed in 3.0.', E_USER_DEPRECATED);
  if ($this->context instanceof ExecutionContextInterface2Dot5) {
    return $this->context
      ->buildViolation($message, $parameters);
  }
  return new LegacyConstraintViolationBuilder($this->context, $message, $parameters);
}