From a74118e5d4ee56d754c1c8cc6b1290d1546513bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 24 Apr 2025 22:00:13 +0200 Subject: [PATCH] Add context parameter to export generation methods --- src/Bundle/ChillMainBundle/Export/ExportGenerator.php | 2 ++ src/Bundle/ChillMainBundle/Export/FormatterInterface.php | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Export/ExportGenerator.php b/src/Bundle/ChillMainBundle/Export/ExportGenerator.php index 1e865e20a..d01152016 100644 --- a/src/Bundle/ChillMainBundle/Export/ExportGenerator.php +++ b/src/Bundle/ChillMainBundle/Export/ExportGenerator.php @@ -112,6 +112,7 @@ final readonly class ExportGenerator $data['export'], $filtersData, $aggregatorsData, + $context, ); } @@ -125,6 +126,7 @@ final readonly class ExportGenerator $data['export'], $filtersData, $aggregatorsData, + $context, ); return new FormattedExportGeneration($generatedExport->getContent(), $generatedExport->headers->get('content-type')); diff --git a/src/Bundle/ChillMainBundle/Export/FormatterInterface.php b/src/Bundle/ChillMainBundle/Export/FormatterInterface.php index e45549758..ac9c3e903 100644 --- a/src/Bundle/ChillMainBundle/Export/FormatterInterface.php +++ b/src/Bundle/ChillMainBundle/Export/FormatterInterface.php @@ -15,7 +15,7 @@ use Symfony\Component\Form\FormBuilderInterface; use Symfony\Contracts\Translation\TranslatableInterface; /** - * @method generate($result, $formatterData, string $exportAlias, array $exportData, array $filtersData, array $aggregatorsData): FormattedExportGeneration + * @method generate($result, $formatterData, string $exportAlias, array $exportData, array $filtersData, array $aggregatorsData, ExportGenerationContext $context): FormattedExportGeneration */ interface FormatterInterface { @@ -51,8 +51,8 @@ interface FormatterInterface * @param mixed[] $result The result, as given by the ExportInterface * @param mixed[] $formatterData collected from the current form * @param string $exportAlias the id of the current export - * @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data * @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data + * @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data * * @return \Symfony\Component\HttpFoundation\Response The response to be shown * @@ -65,6 +65,7 @@ interface FormatterInterface array $exportData, array $filtersData, array $aggregatorsData, + ExportGenerationContext $context, ); public function getType(): string;