8000 Update callback exemple as setPropertyPath has been removed · web-dev/symfony-docs@9711401 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9711401

Browse files
committed
Update callback exemple as setPropertyPath has been removed
1 parent 2039610 commit 9711401

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

reference/constraints/Callback.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ those errors should be attributed::
8585
8686
// check if the name is actually a fake name
8787
if (in_array($this->getFirstName(), $fakeNames)) {
88-
$propertyPath = $context->getPropertyPath() . '.firstName';
89-
$context->setPropertyPath($propertyPath);
90-
$context->addViolation('This name sounds totally fake!', array(), null);
88+
$context->addViolationAtSubPath('firstname', 'This name sounds totally fake!', array(), null);
9189
}
9290
}
9391

0 commit comments

Comments
 (0)
0