Refactor method signatures for stricter type safety

Updated method parameters to enforce stricter type declarations, improving code clarity and reducing potential runtime errors. This change ensures better consistency across interfaces and aligns with modern PHP typing practices.
This commit is contained in:
Julien Fastré 2025-04-08 13:40:05 +02:00
parent 0d0a626f50
commit 6f1a26742d
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
3 changed files with 5 additions and 5 deletions

View File

@ -96,7 +96,7 @@ interface AggregatorInterface extends ModifierInterface
* *
* @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(); }` * @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): callable; public function getLabels(string $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

@ -101,7 +101,7 @@ interface ExportInterface extends ExportElementInterface
* *
* @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(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(); }`
*/ */
public function getLabels($key, array $values, mixed $data); public function getLabels(string $key, array $values, mixed $data);
/** /**
* 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

@ -59,9 +59,9 @@ interface FormatterInterface
* @deprecated use generate instead * @deprecated use generate instead
*/ */
public function getResponse( public function getResponse(
$result, array $result,
$formatterData, array $formatterData,
$exportAlias, string $exportAlias,
array $exportData, array $exportData,
array $filtersData, array $filtersData,
array $aggregatorsData, array $aggregatorsData,