chore: code cleanup with rector and php-cs-fixer
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user