DX: apply rector rules up to php8.0

This commit is contained in:
2023-04-15 01:05:37 +02:00
parent d8870e906f
commit dde3002100
714 changed files with 2348 additions and 9263 deletions

View File

@@ -347,27 +347,12 @@ class SpreadSheetFormatter implements FormatterInterface
$line = $this->addContentTable($worksheet, $sortedResult, $line);
switch ($this->formatterData['format']) {
case 'ods':
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Ods');
break;
case 'xlsx':
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
break;
case 'csv':
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Csv');
break;
default:
// this should not happen
// throw an exception to ensure that the error is catched
throw new LogicException();
}
$writer = match ($this->formatterData['format']) {
'ods' => \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Ods'),
'xlsx' => \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx'),
'csv' => \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Csv'),
default => throw new LogicException(),
};
$writer->save($this->tempfile);
}
@@ -435,11 +420,10 @@ class SpreadSheetFormatter implements FormatterInterface
* Get the displayable result.
*
* @param string $key
* @param mixed $value
*
* @return string
*/
protected function getDisplayableResult($key, $value)
protected function getDisplayableResult($key, mixed $value)
{
if (false === $this->cacheDisplayableResultIsInitialized) {
$this->initializeCache($key);