mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Refactor type annotations in export interfaces
Updated return type annotations in `AggregatorInterface` for clarity and adjusted generics in `ListInterface` to better reflect supported query types. This improves code readability and strengthens type safety.
This commit is contained in:
parent
d9251239f7
commit
ec5f4ed1d6
@ -94,7 +94,7 @@ 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(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;
|
||||
|
||||
|
@ -11,6 +11,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Export;
|
||||
|
||||
use Doctrine\ORM\NativeQuery;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
|
||||
/**
|
||||
* Define methods to export list.
|
||||
*
|
||||
@ -20,7 +23,8 @@ namespace Chill\MainBundle\Export;
|
||||
*
|
||||
* When used, the `ExportManager` will not handle aggregator for this class.
|
||||
*
|
||||
* @template Q of QueryBuilder|NativeQuery
|
||||
* @template D of array
|
||||
* @template-implements ExportInterface<D>
|
||||
* @template-extends ExportInterface<Q, D>
|
||||
*/
|
||||
interface ListInterface extends ExportInterface {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user