You are here

protected function ConstraintValidator::buildViolationInContext in Zircon Profile 8

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

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

Parameters

ExecutionContextInterface $context The context to use:

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 87

Class

ConstraintValidator
Base class for constraint validators.

Namespace

Symfony\Component\Validator

Code

protected function buildViolationInContext(ExecutionContextInterface $context, $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 ($context instanceof ExecutionContextInterface2Dot5) {
    return $context
      ->buildViolation($message, $parameters);
  }
  return new LegacyConstraintViolationBuilder($context, $message, $parameters);
}