minor #13568 [Validator] use 2.5 API in LengthValidator (nicolas-grekas)
This PR was merged into the 2.5 branch.
Discussion
----------
[Validator] use 2.5 API in LengthValidator
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | -
| License | MIT
| Doc PR | -
Commits
-------
7602454
[Validator] use 2.5 API in LengthValidator
This commit is contained in:
commit
ed18cde58d
|
@ -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