From a6e523ee0a751a5993c7baaddd3b6d8df16e9082 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 24 Apr 2025 14:21:35 +0200 Subject: [PATCH] Fix string formatting style in SavedExportController Replaced double quotes with single quotes for consistency in exception messages and translatable strings. This change improves code readability and maintains uniformity across the file. --- .../Controller/SavedExportController.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Controller/SavedExportController.php b/src/Bundle/ChillMainBundle/Controller/SavedExportController.php index 2a07f2ac7..bce09488a 100644 --- a/src/Bundle/ChillMainBundle/Controller/SavedExportController.php +++ b/src/Bundle/ChillMainBundle/Controller/SavedExportController.php @@ -118,7 +118,7 @@ final readonly class SavedExportController public function duplicate(SavedExport $previousSavedExport, Request $request): Response { if (!$this->security->isGranted(SavedExportVoter::GENERATE, $previousSavedExport)) { - throw new AccessDeniedHttpException("Not allowed to see this saved export"); + throw new AccessDeniedHttpException('Not allowed to see this saved export'); } $user = $this->security->getUser(); @@ -135,7 +135,7 @@ final readonly class SavedExportController ->setTitle( $request->query->has('title') ? $request->query->get('title') : - $previousSavedExport->getTitle() . ' (' . $this->translator->trans('saved_export.Duplicated') . ' ' . (new \DateTimeImmutable('now'))->format('d-m-Y H:i:s') . ')' + $previousSavedExport->getTitle().' ('.$this->translator->trans('saved_export.Duplicated').' '.(new \DateTimeImmutable('now'))->format('d-m-Y H:i:s').')' ); return $this->handleEdit($savedExport, $request); @@ -207,15 +207,15 @@ final readonly class SavedExportController public function updateOptionsFromGeneration(SavedExport $savedExport, ExportGeneration $exportGeneration, Request $request): Response { if (!$this->security->isGranted(SavedExportVoter::EDIT, $savedExport)) { - throw new AccessDeniedHttpException("You are not allowed to access this saved export"); + throw new AccessDeniedHttpException('You are not allowed to access this saved export'); } if (!$this->security->isGranted(ExportGenerationVoter::VIEW, $exportGeneration)) { - throw new AccessDeniedHttpException("You are not allowed to access this export generation"); + throw new AccessDeniedHttpException('You are not allowed to access this export generation'); } if ($savedExport->getExportAlias() !== $exportGeneration->getExportAlias()) { - throw new UnprocessableEntityHttpException("export alias does not match"); + throw new UnprocessableEntityHttpException('export alias does not match'); } $savedExport->setOptions($exportGeneration->getOptions()); @@ -224,7 +224,7 @@ final readonly class SavedExportController $session = $request->getSession(); if ($session instanceof Session) { - $session->getFlashBag()->add('success', new TranslatableMessage("saved_export.Options updated successfully")); + $session->getFlashBag()->add('success', new TranslatableMessage('saved_export.Options updated successfully')); } return new RedirectResponse(