cs: Enable risky rule static_lambda.

This commit is contained in:
Pol Dellaiera
2021-11-30 11:43:34 +01:00
parent a9188355c5
commit 91d12c4a96
111 changed files with 212 additions and 212 deletions

View File

@@ -168,7 +168,7 @@ class CSVFormatter implements FormatterInterface
// gather data in an array
foreach ($keys as $key) {
$values = array_map(function ($row) use ($key, $alias) {
$values = array_map(static function ($row) use ($key, $alias) {
if (!array_key_exists($key, $row)) {
throw new LogicException("the key '" . $key . "' is declared by "
. "the aggregator with alias '" . $alias . "' but is not "
@@ -195,7 +195,7 @@ class CSVFormatter implements FormatterInterface
$keys = $this->export->getQueryKeys($this->exportData);
foreach ($keys as $key) {
$values = array_map(function ($row) use ($key, $export) {
$values = array_map(static function ($row) use ($key, $export) {
if (!array_key_exists($key, $row)) {
throw new LogicException("the key '" . $key . "' is declared by "
. "the export with title '" . $export->getTitle() . "' but is not "

View File

@@ -196,7 +196,7 @@ class CSVListFormatter implements FormatterInterface
foreach ($keys as $key) {
// get an array with all values for this key if possible
$values = array_map(function ($v) use ($key) { return $v[$key]; }, $this->result);
$values = array_map(static function ($v) use ($key) { return $v[$key]; }, $this->result);
// store the label in the labelsCache property
$this->labelsCache[$key] = $export->getLabels($key, $values, $this->exportData);
}

View File

@@ -184,7 +184,7 @@ class CSVPivotedListFormatter implements FormatterInterface
foreach ($keys as $key) {
// get an array with all values for this key if possible
$values = array_map(function ($v) use ($key) { return $v[$key]; }, $this->result);
$values = array_map(static function ($v) use ($key) { return $v[$key]; }, $this->result);
// store the label in the labelsCache property
$this->labelsCache[$key] = $export->getLabels($key, $values, $this->exportData);
}

View File

@@ -255,7 +255,7 @@ class SpreadsheetListFormatter implements FormatterInterface
foreach ($keys as $key) {
// get an array with all values for this key if possible
$values = array_map(function ($v) use ($key) { return $v[$key]; }, $this->result);
$values = array_map(static function ($v) use ($key) { return $v[$key]; }, $this->result);
// store the label in the labelsCache property
$this->labelsCache[$key] = $export->getLabels($key, $values, $this->exportData);
}