mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-27 10:03:49 +00:00
ExportInterface::getLabels should return a closure
This commit is contained in:
@@ -315,18 +315,13 @@ class CSVFormatter implements FormatterInterface
|
||||
foreach ($results as $row) {
|
||||
$line = array();
|
||||
foreach ($headers as $key) {
|
||||
if (!array_key_exists($row[$key], $labels[$key])) {
|
||||
throw new \LogicException("The value '".$row[$key]."' "
|
||||
. "is not available from the labels defined by aggregator or report. "
|
||||
. "The key provided by aggregator or report is '$key'");
|
||||
}
|
||||
|
||||
$line[] = $labels[$key][$row[$key]];
|
||||
$line[] = call_user_func($labels[$key], $row[$key]);
|
||||
}
|
||||
|
||||
//append result
|
||||
foreach ($resultsKeys as $key) {
|
||||
$line[] = $labels[$key][$row[$key]];
|
||||
$line[] = call_user_func($labels[$key], $row[$key]);
|
||||
}
|
||||
|
||||
$r[] = $line;
|
||||
|
Reference in New Issue
Block a user