Skip to content

Commit

Permalink
minor symfony#13568 [Validator] use 2.5 API in LengthValidator (nicol…
Browse files Browse the repository at this point in the history
…as-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
  • Loading branch information
nicolas-grekas committed Feb 1, 2015
2 parents f1f657a + 7602454 commit ed18cde
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ public function validate($value, Constraint $constraint)
}

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;
}
Expand Down

0 comments on commit ed18cde

Please sign in to comment.