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
+1 -1
View File
@@ -27,7 +27,7 @@ class BookingConfigurator
private readonly ParticipantEligibilityChecker $participantEligibilityService,
private readonly BookingStatusRuleRegistry $bookingStatusRuleRegistry,
private readonly AgencyLoader $agencyLoader,
#[Autowire('%default_booking_status%')]
#[Autowire(param: 'default_booking_status')]
private readonly string $defaultBookingStatus,
) {
}
+2 -1
View File
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace App\Service;
use App\BusProNet\Model\Address;
use App\BusProNet\Model\Service;
use App\BusProNet\Model\Travel;
use App\Form\Model\BookingDto;
@@ -120,7 +121,7 @@ class BookingEditDraftMerger
}
if (null === $participant->address) {
$participant->address = new \App\BusProNet\Model\Address();
$participant->address = new Address();
}
if (true === array_key_exists('street', $data)) {
+3 -1
View File
@@ -9,8 +9,8 @@ use App\BusProNet\Exception\ApiClientException;
use App\BusProNet\Exception\TimeoutException;
use App\BusProNet\Model\Notification;
use App\Entity\User;
use App\Model\BookingEditSubmissionResult;
use App\Form\Model\BookingDto;
use App\Model\BookingEditSubmissionResult;
use Psr\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\Request;
@@ -76,6 +76,7 @@ class BookingEditSubmitter
'booking_id' => $bookingId,
'message' => $response->message,
]);
return new BookingEditSubmissionResult(
true === $response->isError()
? BookingEditSubmissionResult::STATUS_NOTIFICATION_ERROR
@@ -118,6 +119,7 @@ class BookingEditSubmitter
'email' => $email,
'booking_id' => $bookingId,
]);
return new BookingEditSubmissionResult(
BookingEditSubmissionResult::STATUS_TIMEOUT,
null,
+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,
+1 -1
View File
@@ -4,9 +4,9 @@ declare(strict_types=1);
namespace App\Service;
use App\BusProNet\XmlLoader\TravelLoader;
use App\Model\BpnXmlSnapshotRefreshPlan;
use App\Model\BpnXmlSnapshotRefreshResult;
use App\BusProNet\XmlLoader\TravelLoader;
use Psr\Log\LoggerInterface;
final class BpnXmlSnapshotRefreshManager
+2 -2
View File
@@ -11,8 +11,8 @@ use App\Exception\NewsletterListNotAllowedException;
use App\Exception\NewsletterProviderException;
use App\Model\NewsletterConfirmationResult;
use App\Model\NewsletterSubscriptionRequestResult;
use App\Repository\NewsletterOptInRequestRepository;
use App\Repository\NewsletterConsentRepository;
use App\Repository\NewsletterOptInRequestRepository;
use Doctrine\ORM\EntityManagerInterface;
use Psr\Log\LoggerInterface;
@@ -72,7 +72,7 @@ class NewsletterManager
}
/**
* @param list<int|string> $mailjetListIds
* @param list<int|string> $mailjetListIds
* @param list<int|string>|null $knownMailjetListIds
*/
public function requestApiSubscription(string $email, array $mailjetListIds, ?array $knownMailjetListIds = null, ?string $firstName = null, ?string $lastName = null): NewsletterSubscriptionRequestResult
@@ -5,7 +5,6 @@ declare(strict_types=1);
namespace App\Service;
use App\BusProNet\Model\Insurance;
use App\BusProNet\Model\Service;
use App\Form\Model\BookingDto;
use App\Form\Model\ParticipantDto;