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.
This commit is contained in:
Julien Fastré 2025-04-08 10:37:47 +02:00
parent 8e952cc966
commit b2d3d806b6
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
3 changed files with 6 additions and 3 deletions

View File

@ -94,9 +94,9 @@ interface AggregatorInterface extends ModifierInterface
* @param string $key The column key, as added in the query * @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') * @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 * give the list of keys the current export added to the queryBuilder in

View File

@ -28,7 +28,7 @@ use Symfony\Contracts\Translation\TranslatableInterface;
* @example Chill\PersonBundle\Export\CountPerson an example of implementation * @example Chill\PersonBundle\Export\CountPerson an example of implementation
* *
* @template Q of QueryBuilder|NativeQuery * @template Q of QueryBuilder|NativeQuery
* @tempalte D of array * @template D of array
*/ */
interface ExportInterface extends ExportElementInterface interface ExportInterface extends ExportElementInterface
{ {

View File

@ -19,5 +19,8 @@ namespace Chill\MainBundle\Export;
* (and list does not support aggregation on their data). * (and list does not support aggregation on their data).
* *
* When used, the `ExportManager` will not handle aggregator for this class. * When used, the `ExportManager` will not handle aggregator for this class.
*
* @template D of array
* @template-implements ExportInterface<D>
*/ */
interface ListInterface extends ExportInterface {} interface ListInterface extends ExportInterface {}