chore: fix phpstan errors

This commit is contained in:
Björn Fromme committed 2026-04-16 16:27:35 +02:00
1 parent 4e925171b3
commit 0fcecc9c58
109 files changed
+510 -429

No files matched your search

+9 -7
View File
@@ -31,7 +31,7 @@ class BookingPricingAssembler
/**
* Assembles a complete pricing breakdown for display or diagnostic use.
*
* @return array{rooms: array, services: array, grandTotal: float, surcharges?: array}
* @return array{rooms: array<int, array<string, mixed>>, services: array<int, array<string, mixed>>, grandTotal: float, surcharges?: array<int, array<string, mixed>>}
*/
public function getPricingBreakdown(
BookingDto $bookingDto,
@@ -251,7 +251,8 @@ class BookingPricingAssembler
foreach ($serviceAggregation as $serviceData) {
$subType = $serviceData['subType'] ?? 'other';
if (null === $subType || '' === $subType) {
if ('' === $subType) {
$subType = 'other';
}
@@ -308,6 +309,7 @@ class BookingPricingAssembler
return Constants::SERVICE_LABELS[$subType] ?? 'Sonstige Leistungen';
}
/** @param array<string, array<string, mixed>> $serviceAggregation */
private function aggregateParticipantServices(
ParticipantDto $participant,
array &$serviceAggregation,
@@ -338,16 +340,15 @@ class BookingPricingAssembler
];
foreach ($multipleServiceArrays as $serviceArray) {
if (true === is_array($serviceArray)) {
foreach ($serviceArray as $service) {
if ($service instanceof Service && null !== $service->price) {
$this->addToServiceAggregation($serviceAggregation, $service);
}
foreach ($serviceArray as $service) {
if (null !== $service->price) {
$this->addToServiceAggregation($serviceAggregation, $service);
}
}
}
}
/** @param array<string, array<string, mixed>> $serviceAggregation */
private function addToServiceAggregation(array &$serviceAggregation, Service $service, int $quantity = 1): void
{
$serviceKey = $service->id.'_'.$service->label;
@@ -367,6 +368,7 @@ class BookingPricingAssembler
$serviceAggregation[$serviceKey]['totalPrice'] += $service->price * $quantity;
}
/** @param array<string, array<string, mixed>> $serviceAggregation */
private function addInsuranceToServiceAggregation(array &$serviceAggregation, Insurance $insurance, int $quantity = 1): void
{
$serviceKey = $insurance->id.'_'.$insurance->label;