From b2d3d806b6f88426b9866f204c763f4670b16b3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 8 Apr 2025 10:37:47 +0200 Subject: [PATCH] Fix PHPDocs and return type declarations in export interfaces Corrected typos in PHPDocs, added missing type templates, and ensured proper return type declarations. These changes improve code readability, consistency, and type safety across export-related interfaces. --- src/Bundle/ChillMainBundle/Export/AggregatorInterface.php | 4 ++-- src/Bundle/ChillMainBundle/Export/ExportInterface.php | 2 +- src/Bundle/ChillMainBundle/Export/ListInterface.php | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Bundle/ChillMainBundle/Export/AggregatorInterface.php b/src/Bundle/ChillMainBundle/Export/AggregatorInterface.php index 126b7580b..98fca1de2 100644 --- a/src/Bundle/ChillMainBundle/Export/AggregatorInterface.php +++ b/src/Bundle/ChillMainBundle/Export/AggregatorInterface.php @@ -94,9 +94,9 @@ interface AggregatorInterface extends ModifierInterface * @param string $key The column key, as added in the query * @param mixed[] $values The values from the result. if there are duplicates, those might be given twice. Example: array('FR', 'BE', 'CZ', 'FR', 'BE', 'FR') * - * @return (callable(string|int|float|'_header'|null $value): string|int|\DateTimeInterface|TranslatableInterface) where the first argument is the value, and the function should return the label to show in the formatted file. Example : `function($countryCode) use ($countries) { return $countries[$countryCode]->getName(); }` + * @return callable(mixed $value): string|int|\DateTimeInterface|TranslatableInterface where the first argument is the value, and the function should return the label to show in the formatted file. Example : `function($countryCode) use ($countries) { return $countries[$countryCode]->getName(); }` */ - public function getLabels($key, array $values, mixed $data); + public function getLabels($key, array $values, mixed $data): callable; /** * give the list of keys the current export added to the queryBuilder in diff --git a/src/Bundle/ChillMainBundle/Export/ExportInterface.php b/src/Bundle/ChillMainBundle/Export/ExportInterface.php index a44aa681b..02338d7cb 100644 --- a/src/Bundle/ChillMainBundle/Export/ExportInterface.php +++ b/src/Bundle/ChillMainBundle/Export/ExportInterface.php @@ -28,7 +28,7 @@ use Symfony\Contracts\Translation\TranslatableInterface; * @example Chill\PersonBundle\Export\CountPerson an example of implementation * * @template Q of QueryBuilder|NativeQuery - * @tempalte D of array + * @template D of array */ interface ExportInterface extends ExportElementInterface { diff --git a/src/Bundle/ChillMainBundle/Export/ListInterface.php b/src/Bundle/ChillMainBundle/Export/ListInterface.php index 9b88525ca..d23cce0c0 100644 --- a/src/Bundle/ChillMainBundle/Export/ListInterface.php +++ b/src/Bundle/ChillMainBundle/Export/ListInterface.php @@ -19,5 +19,8 @@ namespace Chill\MainBundle\Export; * (and list does not support aggregation on their data). * * When used, the `ExportManager` will not handle aggregator for this class. + * + * @template D of array + * @template-implements ExportInterface */ interface ListInterface extends ExportInterface {}