From f73b5fb13a0eb25ed0edcc949a26f650f8339d8a Mon Sep 17 00:00:00 2001 From: MasterB Date: Fri, 8 Aug 2014 12:39:56 +0200 Subject: [PATCH] Update Callback.rst Some methodes and classes are deprecated since version 2.5 --- reference/constraints/Callback.rst | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/reference/constraints/Callback.rst b/reference/constraints/Callback.rst index 36b55e97910..08dfd728d78 100644 --- a/reference/constraints/Callback.rst +++ b/reference/constraints/Callback.rst @@ -100,7 +100,7 @@ can set "violations" directly on this object and determine to which field those errors should be attributed:: // ... - use Symfony\Component\Validator\ExecutionContextInterface; + use Symfony\Component\Validator\Context\ExecutionContextInterface; class Author { @@ -114,12 +114,11 @@ those errors should be attributed:: // check if the name is actually a fake name if (in_array($this->getFirstName(), $fakeNames)) { - $context->addViolationAt( - 'firstName', - 'This name sounds totally fake!', - array(), - null - ); + $context + ->buildViolation('This name sounds totally fake!', array()) + ->atPath('firstName') + ->addViolation() + ; } } }