Skip to content

Commit 7602454

Browse files
[Validator] use 2.5 API in LengthValidator
1 parent f1f657a commit 7602454

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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy