From b9231a91a3882828dad396f520a4463f72100113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Tue, 12 Sep 2023 15:51:59 +0200 Subject: [PATCH] Fix CountryOfBirthAggregator: allow to receive null data in getLabels method --- .../Aggregator/PersonAggregators/CountryOfBirthAggregator.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php index 27191d21f..897cac14a 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/PersonAggregators/CountryOfBirthAggregator.php @@ -36,7 +36,7 @@ final readonly class CountryOfBirthAggregator implements AggregatorInterface, Ex return null; } - public function alterQuery(QueryBuilder $qb, $data) + public function alterQuery(QueryBuilder $qb, $data): void { // add a clause in select part if ('country' === $data['group_by_level']) { @@ -139,7 +139,7 @@ final readonly class CountryOfBirthAggregator implements AggregatorInterface, Ex ]; } - return static fn (string $value): string => $labels[$value]; + return static fn (?string $value): string => $labels[(string) $value]; } public function getQueryKeys($data)