10000 minor #13568 [Validator] use 2.5 API in LengthValidator (nicolas-grekas) · symfony/symfony@ed18cde · GitHub
[go: up one dir, main page]

Skip to content

Commit ed18cde

Browse files
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
2 parents f1f657a + 7602454 commit ed18cde

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/Symfony/Component/Validator/Constraints/LengthValidator.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ public function validate($value, Constraint $constraint)
6464
}
6565

6666
if ($invalidCharset) {
67-
$this->context->addViolation($constraint->charsetMessage, array(
68-
'{{ value }}' => $this->formatValue($stringValue),
69-
'{{ charset }}' => $constraint->charset,
70-
), $value);
67+
$this->buildViolation($constraint->charsetMessage)
68+
->setParameter('{{ value }}', $this->formatValue($stringValue))
69+
->setParameter('{{ charset }}', $constraint->charset)
70+
->setInvalidValue($value)
71+
->addViolation();
7172

7273
return;
7374
}

0 commit comments

Comments
 (0)
0