Closed
Description
In the class Symfony\Component\Validator\Constraints\AbstractComparisonValidator
I am suspecting that the constraint message is not being properly parametrized. Check the validate
method of that class:
public function validate($value, Constraint $constraint)
{
if (!$constraint instanceof AbstractComparison) {
throw new UnexpectedTypeException($constraint, __NAMESPACE__.'\AbstractComparison');
}
if (null === $value) {
return;
}
if (!$this->compareValues($value, $constraint->value)) {
$this->context->addViolation($constraint->message, array(
'{{ value }}' => $this->valueToString($constraint->value),
'{{ compared_value }}' => $this->valueToString($constraint->value),
'{{ compared_value_type }}' => $this->valueToType($constraint->value)
));
}
}
It's like {{ value }}
should be the value that is being compared, namely, $value
variable. Am I wrong?