From a41483be00cd1475a033ba33e4c46163849d6ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 6 Oct 2022 22:44:31 +0200 Subject: [PATCH] ACP ConfidentialFilter: Do not loop on choices to show the picked one --- .../AccompanyingCourseFilters/ConfidentialFilter.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php index 3eb4a2554..8fcd874fe 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/AccompanyingCourseFilters/ConfidentialFilter.php @@ -73,15 +73,11 @@ class ConfidentialFilter implements FilterInterface public function describeAction($data, $format = 'string'): array { - foreach (self::CHOICES as $k => $v) { - if ($v === $data['accepted_confidentials']) { - $choice = $k; - } - } - return [ 'Filtered by confidential: only %confidential%', [ - '%confidential%' => $this->translator->trans($choice), + '%confidential%' => $this->translator->trans( + $data['accepted_confidentials'] ? 'is confidential' : 'is not confidential' + ), ], ]; }