[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) {
|
if ($invalidCharset) {
|
||||||
$this->context->addViolation($constraint->charsetMessage, array(
|
$this->buildViolation($constraint->charsetMessage)
|
||||||
'{{ value }}' => $this->formatValue($stringValue),
|
->setParameter('{{ value }}', $this->formatValue($stringValue))
|
||||||
'{{ charset }}' => $constraint->charset,
|
->setParameter('{{ charset }}', $constraint->charset)
|
||||||
), $value);
|
->setInvalidValue($value)
|
||||||
|
->addViolation();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue