mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Fix implicit variable creation.
This commit is contained in:
@@ -143,6 +143,8 @@ final class CountryOfBirthAggregator implements AggregatorInterface, ExportEleme
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
{
|
||||
$labels = [];
|
||||
|
||||
if ($data['group_by_level'] === 'country') {
|
||||
$qb = $this->countriesRepository->createQueryBuilder('c');
|
||||
|
||||
@@ -153,15 +155,17 @@ final class CountryOfBirthAggregator implements AggregatorInterface, ExportEleme
|
||||
->getResult(\Doctrine\ORM\Query::HYDRATE_SCALAR);
|
||||
|
||||
// initialize array and add blank key for null values
|
||||
$labels[''] = $this->translator->trans('without data');
|
||||
$labels['_header'] = $this->translator->trans('Country of birth');
|
||||
$labels = [
|
||||
'' => $this->translator->trans('without data'),
|
||||
'_header' => $this->translator->trans('Country of birth'),
|
||||
];
|
||||
|
||||
foreach($countries as $row) {
|
||||
$labels[$row['c_countryCode']] = $this->translatableStringHelper->localize($row['c_name']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} elseif ($data['group_by_level'] === 'continent') {
|
||||
|
||||
if ($data['group_by_level'] === 'continent') {
|
||||
$labels = array(
|
||||
'EU' => $this->translator->trans('Europe'),
|
||||
'AS' => $this->translator->trans('Asia'),
|
||||
@@ -170,13 +174,12 @@ final class CountryOfBirthAggregator implements AggregatorInterface, ExportEleme
|
||||
'SA' => $this->translator->trans('South America'),
|
||||
'NA' => $this->translator->trans('North America'),
|
||||
'OC' => $this->translator->trans('Oceania'),
|
||||
'' => $this->translator->trans('without data'),
|
||||
'' => $this->translator->trans('without data'),
|
||||
'_header' => $this->translator->trans('Continent of birth')
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return function($value) use ($labels) {
|
||||
return function(string $value) use ($labels): string {
|
||||
return $labels[$value];
|
||||
};
|
||||
|
||||
|
@@ -144,6 +144,8 @@ final class NationalityAggregator implements AggregatorInterface, ExportElementV
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
{
|
||||
$labels = [];
|
||||
|
||||
if ($data['group_by_level'] === 'country') {
|
||||
$qb = $this->countriesRepository->createQueryBuilder('c');
|
||||
|
||||
@@ -154,15 +156,17 @@ final class NationalityAggregator implements AggregatorInterface, ExportElementV
|
||||
->getResult(\Doctrine\ORM\Query::HYDRATE_SCALAR);
|
||||
|
||||
// initialize array and add blank key for null values
|
||||
$labels[''] = $this->translator->trans('without data');
|
||||
$labels['_header'] = $this->translator->trans('Nationality');
|
||||
$labels = [
|
||||
'' => $this->translator->trans('without data'),
|
||||
'_header' => $this->translator->trans('Nationality'),
|
||||
];
|
||||
|
||||
foreach($countries as $row) {
|
||||
$labels[$row['c_countryCode']] = $this->translatableStringHelper->localize($row['c_name']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} elseif ($data['group_by_level'] === 'continent') {
|
||||
|
||||
if ($data['group_by_level'] === 'continent') {
|
||||
$labels = array(
|
||||
'EU' => $this->translator->trans('Europe'),
|
||||
'AS' => $this->translator->trans('Asia'),
|
||||
@@ -176,8 +180,7 @@ final class NationalityAggregator implements AggregatorInterface, ExportElementV
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
return function($value) use ($labels) {
|
||||
return function(string $value) use ($labels): string {
|
||||
return $labels[$value];
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user