Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ed18cde

Browse filesBrowse 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
Copy full SHA for ed18cde

File tree

1 file changed

+5
-4
lines changed
Filter options

1 file changed

+5
-4
lines changed

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Constraints/LengthValidator.php
+5-4Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.