Skip to content

Commit 3e87f14

Browse files
committed
Added missing atPath method for class constraint validator
1 parent 193a264 commit 3e87f14

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cookbook/validation/custom_constraint.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ With this, the validator ``validate()`` method gets an object as its first argum
232232
if ($protocol->getFoo() != $protocol->getBar()) {
233233
// If you're using the new 2.5 validation API (you probably are!)
234234
$this->context->buildViolation($constraint->message)
235+
->atPath('foo')
235236
->addViolation();
236237

237238
// If you're using the old 2.4 validation API

0 commit comments

Comments
 (0)