/** * Add a violation. * * @param mixed $value The value that should be validated. * @param Constraint $constraint The constraint for the validation. */ private function addViolation($value, Constraint $constraint) { $this->context->addViolation($constraint->getMessage(), array('{{ type }}' => $constraint->getType(), '{{ value }}' => $value)); }