diff --git a/Entity/Person.php b/Entity/Person.php index 92220091e..cf88be3bb 100644 --- a/Entity/Person.php +++ b/Entity/Person.php @@ -723,11 +723,11 @@ class Person implements HasCenterInterface { public function isAddressesValid(ExecutionContextInterface $context) { if ($this->hasTwoAdressWithSameValidFromDate()) { - $context->addViolationAt( - 'addresses', - 'Two addresses has the same validFrom date', - array() - ); + $context + ->buildViolation('Two addresses has the same validFrom date') + ->atPath('addresses') + ->addViolation() + ; } }