chore: code cleanup with rector and php-cs-fixer

This commit is contained in:
Björn Fromme
2026-05-04 17:20:01 +02:00
parent d211425ff2
commit 1fa8f88a6d
38 changed files with 130 additions and 98 deletions
+10 -6
View File
@@ -4,8 +4,12 @@ declare(strict_types=1);
namespace App\Service;
use App\BusProNet\Model\Travel;
use App\Entity\BookingEditDraft;
use PhpOffice\PhpSpreadsheet\Cell\Coordinate;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Style\Fill;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
use Symfony\Component\HttpFoundation\StreamedResponse;
@@ -106,11 +110,11 @@ class BookingExporter
/**
* Builds lookup arrays for converting IDs to labels.
*
* @param \App\BusProNet\Model\Travel $travel The travel data
* @param Travel $travel The travel data
*
* @return array{services: array<int, string>, rooms: array<int, string>, pickups: array<int, string>}
*/
private function buildLookups(\App\BusProNet\Model\Travel $travel): array
private function buildLookups(Travel $travel): array
{
$services = [];
$rooms = [];
@@ -174,11 +178,11 @@ class BookingExporter
$headerStyle = [
'font' => ['bold' => true],
'fill' => [
'fillType' => \PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID,
'fillType' => Fill::FILL_SOLID,
'startColor' => ['rgb' => 'E0E0E0'],
],
];
$lastColumn = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::stringFromColumnIndex(count(self::COLUMN_HEADERS));
$lastColumn = Coordinate::stringFromColumnIndex(count(self::COLUMN_HEADERS));
$sheet->getStyle('A1:'.$lastColumn.'1')->applyFromArray($headerStyle);
// Write participant data
@@ -193,7 +197,7 @@ class BookingExporter
// Auto-size columns
foreach (range(1, count(self::COLUMN_HEADERS)) as $col) {
$colLetter = \PhpOffice\PhpSpreadsheet\Cell\Coordinate::stringFromColumnIndex($col);
$colLetter = Coordinate::stringFromColumnIndex($col);
$sheet->getColumnDimension($colLetter)->setAutoSize(true);
}
@@ -208,7 +212,7 @@ class BookingExporter
* @param array<string, array<int, string>> $lookups
*/
private function writeParticipantRow(
\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $sheet,
Worksheet $sheet,
int $row,
array $participant,
array $lookups,