DX: rector rules upt to PHP 74

This commit is contained in:
2023-04-15 00:20:19 +02:00
parent a68190f0c6
commit 858ade467c
213 changed files with 433 additions and 1052 deletions

View File

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

View File

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

View File

@@ -445,7 +445,7 @@ class SpreadSheetFormatter implements FormatterInterface
$this->initializeCache($key);
}
$value = $value ?? '';
$value ??= '';
return call_user_func($this->cacheDisplayableResult[$key], $value);
}

View File

@@ -249,7 +249,7 @@ class ExportAddressHelper
if (($params & $bitmask) === $bitmask) {
if ('geographical_units' === $key) {
// geographical unit generate keys dynamically, depending on layers
$prefixes = array_merge($prefixes, array_keys($this->generateKeysForUnitsNames($prefix)), array_keys($this->generateKeysForUnitsRefs($prefix)));
$prefixes = [...$prefixes, ...array_keys($this->generateKeysForUnitsNames($prefix)), ...array_keys($this->generateKeysForUnitsRefs($prefix))];
continue;
}
@@ -257,9 +257,7 @@ class ExportAddressHelper
$prefixes = array_merge(
$prefixes,
array_map(
static function ($item) use ($prefix) {
return $prefix . $item;
},
static fn($item) => $prefix . $item,
self::COLUMN_MAPPING[$key]
)
);