[Validator] use 2.5 API in LengthValidator
This commit is contained in:
parent
f1f657a68d
commit
760245423e
|
@ -64,10 +64,11 @@ class LengthValidator extends ConstraintValidator
|
|||
}
|
||||
|
||||
if ($invalidCharset) {
|
||||
$this->context->addViolation($constraint->charsetMessage, array(
|
||||
'{{ value }}' => $this->formatValue($stringValue),
|
||||
'{{ charset }}' => $constraint->charset,
|
||||
), $value);
|
||||
$this->buildViolation($constraint->charsetMessage)
|
||||
->setParameter('{{ value }}', $this->formatValue($stringValue))
|
||||
->setParameter('{{ charset }}', $constraint->charset)
|
||||
->setInvalidValue($value)
|
||||
->addViolation();
|
||||
|
||||
return;
|
||||
}
|
||||
|
|
Reference in New Issue