From 7d14d39cac906a462666f8fc2a41ea2ec5652d7a Mon Sep 17 00:00:00 2001 From: Hubert Krzysztofiak Date: Thu, 24 Mar 2022 16:17:09 +0100 Subject: [PATCH] Repair bug after change value in consultations --- src/Consultations/ApprovedTermVariables.php | 2 +- src/Consultations/CommonConsultationVariables.php | 4 +--- src/Consultations/ReportTermVariables.php | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/Consultations/ApprovedTermVariables.php b/src/Consultations/ApprovedTermVariables.php index 32fba4a..e269b8a 100644 --- a/src/Consultations/ApprovedTermVariables.php +++ b/src/Consultations/ApprovedTermVariables.php @@ -14,7 +14,7 @@ public static function defaultSectionsContent(): array 'user_name' => self::VAR_USER_NAME, 'consultation' => self::VAR_CONSULTATION_TITLE, 'proposed_term' => self::VAR_CONSULTATION_PROPOSED_TERM - ]),), + ])), ]; } } diff --git a/src/Consultations/CommonConsultationVariables.php b/src/Consultations/CommonConsultationVariables.php index aef76cd..c9c6345 100644 --- a/src/Consultations/CommonConsultationVariables.php +++ b/src/Consultations/CommonConsultationVariables.php @@ -13,15 +13,13 @@ abstract class CommonConsultationVariables extends EmailVariables const VAR_CONSULTATION_TITLE = '@VarConsultationTitle'; const VAR_CONSULTATION_PROPOSED_TERM = '@VarConsultationProposedTerm'; - - public static function mockedVariables(?User $user = null): array { $faker = \Faker\Factory::create(); return array_merge(parent::mockedVariables(), [ self::VAR_USER_NAME => $faker->name(), self::VAR_CONSULTATION_TITLE => $faker->word(), - + self::VAR_CONSULTATION_PROPOSED_TERM => $faker->dateTime(), ]); } diff --git a/src/Consultations/ReportTermVariables.php b/src/Consultations/ReportTermVariables.php index aa3fd85..fc103dd 100644 --- a/src/Consultations/ReportTermVariables.php +++ b/src/Consultations/ReportTermVariables.php @@ -28,7 +28,7 @@ public static function requiredVariablesInSection(string $sectionKey): array public static function variablesFromEvent(EventWrapper $event): array { return array_merge(parent::variablesFromEvent($event), [ - self::VAR_CONSULTATION_BUYER_NAME => $event->getConsultationTerm()->orderItem->order->user->name, + self::VAR_CONSULTATION_BUYER_NAME => $event->getConsultationTerm()->user->name, ]); }