From 7dfbe88ce6c58d1f86b8df4bc3c170e9928c2d7e Mon Sep 17 00:00:00 2001 From: Mat Date: Thu, 18 Oct 2018 12:20:32 +0200 Subject: [PATCH] fix sf3 depreciated addViolationAt() method cfr vendor/symfony/symfony/UPGRADE-3.0.md:1719 --- Entity/AccompanyingPeriod.php | 6 +++--- Entity/Person.php | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Entity/AccompanyingPeriod.php b/Entity/AccompanyingPeriod.php index 6aa8a28a1..2c4132698 100644 --- a/Entity/AccompanyingPeriod.php +++ b/Entity/AccompanyingPeriod.php @@ -224,9 +224,9 @@ class AccompanyingPeriod } if (! $this->isClosingAfterOpening()) { - $context->addViolationAt('dateClosing', - 'The date of closing is before the date of opening', - array(), null); + $context->buildViolation('The date of closing is before the date of opening') + ->atPath('dateClosing') + ->addViolation(); } } diff --git a/Entity/Person.php b/Entity/Person.php index c86490331..7d19ccc3c 100644 --- a/Entity/Person.php +++ b/Entity/Person.php @@ -735,15 +735,15 @@ class Person implements HasCenterInterface { if ($r !== true) { if ($r['result'] === self::ERROR_PERIODS_ARE_COLLAPSING) { - $context->addViolationAt('accompanyingPeriods', - 'Two accompanying periods have days in commun', - array()); + $context->buildViolation('Two accompanying periods have days in commun') + ->atPath('accompanyingPeriods') + ->addViolation(); } if ($r['result'] === self::ERROR_ADDIND_PERIOD_AFTER_AN_OPEN_PERIOD) { - $context->addViolationAt('accompanyingPeriods', - 'A period is opened and a period is added after it', - array()); + $context->buildViolation('A period is opened and a period is added after it') + ->atPath('accompanyingPeriods') + ->addViolation(); } } }