chore: fix phpstan errors

This commit is contained in:
Björn Fromme
2026-04-16 16:27:35 +02:00
parent 4e925171b3
commit 0fcecc9c58
109 changed files with 510 additions and 429 deletions
+13 -5
View File
@@ -95,8 +95,8 @@ class BookingConfigurator
* Converts a Room model into a RoomSelectionDto with the specified quantity
* selection. Used during booking initialization to create selectable room options.
*
* @param Room $room The room model to convert
* @param array $roomsIdsAndQuantities Array of room ID to quantity mappings
* @param Room $room The room model to convert
* @param array<int|string, int> $roomsIdsAndQuantities Array of room ID to quantity mappings
*
* @return RoomSelectionDto The room selection DTO
*/
@@ -249,6 +249,7 @@ class BookingConfigurator
return $this->participantEligibilityService->isParticipantEligible($bookingDto, $participantIndex);
}
/** @param array<int, Service> $mandatoryAdditionalServices */
private function preselectMandatoryAdditionalServices(
ParticipantDto $participant,
array $mandatoryAdditionalServices,
@@ -266,6 +267,7 @@ class BookingConfigurator
$this->appendAdditionalServices($participant, $eligibleServices, false);
}
/** @param array<int, Service> $autoBookAdditionalServices */
private function preselectAutoBookAdditionalServices(
ParticipantDto $participant,
array $autoBookAdditionalServices,
@@ -283,6 +285,7 @@ class BookingConfigurator
$this->appendAdditionalServices($participant, $eligibleServices, true);
}
/** @param array<int, Service> $mandatorySkiPassServices */
private function preselectMandatorySkiPass(
ParticipantDto $participant,
array $mandatorySkiPassServices,
@@ -308,6 +311,7 @@ class BookingConfigurator
}
}
/** @param array<int, Service> $autoBookSkiPassServices */
private function preselectAutoBookSkiPass(
ParticipantDto $participant,
array $autoBookSkiPassServices,
@@ -338,6 +342,7 @@ class BookingConfigurator
}
}
/** @param array<int, Service> $mandatoryBoardServices */
private function preselectMandatoryBoardServices(
ParticipantDto $participant,
array $mandatoryBoardServices,
@@ -355,6 +360,7 @@ class BookingConfigurator
$this->appendBoardServices($participant, $eligibleServices, false);
}
/** @param array<int, Service> $autoBookBoardServices */
private function preselectAutoBookBoardServices(
ParticipantDto $participant,
array $autoBookBoardServices,
@@ -372,6 +378,7 @@ class BookingConfigurator
$this->appendBoardServices($participant, $eligibleServices, true);
}
/** @param array<int, Service> $mandatoryRentalServices */
private function preselectMandatoryRentals(
ParticipantDto $participant,
array $mandatoryRentalServices,
@@ -395,6 +402,7 @@ class BookingConfigurator
$this->appendRentalServices($participant, $matchingDurationServices, false);
}
/** @param array<int, Service> $autoBookRentalServices */
private function preselectAutoBookRentals(
ParticipantDto $participant,
array $autoBookRentalServices,
@@ -445,7 +453,7 @@ class BookingConfigurator
*/
private function appendAdditionalServices(ParticipantDto $participant, array $services, bool $respectOptOut): void
{
$currentSelections = $participant->additionalServices ?? [];
$currentSelections = $participant->additionalServices;
$currentServiceIds = array_map(static fn (Service $service): ?int => $service->id, $currentSelections);
foreach ($services as $service) {
@@ -469,7 +477,7 @@ class BookingConfigurator
*/
private function appendBoardServices(ParticipantDto $participant, array $services, bool $respectOptOut): void
{
$currentSelections = $participant->board ?? [];
$currentSelections = $participant->board;
$currentServiceIds = array_map(static fn (Service $service): ?int => $service->id, $currentSelections);
foreach ($services as $service) {
@@ -493,7 +501,7 @@ class BookingConfigurator
*/
private function appendRentalServices(ParticipantDto $participant, array $services, bool $respectOptOut): void
{
$currentSelections = $participant->rentals ?? [];
$currentSelections = $participant->rentals;
$currentServiceIds = array_map(static fn (Service $service): ?int => $service->id, $currentSelections);
foreach ($services as $service) {