fix: drop unreachable null check
This commit is contained in:
1 parent
24498e6fd1
commit
2d876152aa
1 file changed
+4
-8
@@ -142,16 +142,12 @@ class ParticipantCardAssembler
|
|||||||
int $index,
|
int $index,
|
||||||
?array $precomputedPrices = null,
|
?array $precomputedPrices = null,
|
||||||
): ParticipantCardPriceDto {
|
): ParticipantCardPriceDto {
|
||||||
// Check if canceled (only possible in edit mode when booking property is set)
|
// Canceled participants only exist in edit mode, where the booking is set
|
||||||
$isCanceled = ($bookingDto->booking?->participantsStatus[$index] ?? null) === 'S';
|
$booking = $bookingDto->booking;
|
||||||
|
|
||||||
if (true === $isCanceled) {
|
if (null !== $booking && 'S' === ($booking->participantsStatus[$index] ?? null)) {
|
||||||
// Calculate surcharge total for canceled participant
|
// Calculate surcharge total for canceled participant
|
||||||
if (null === $bookingDto->booking) {
|
$surcharges = $booking->getSurchargesForParticipant($index);
|
||||||
return new ParticipantCardPriceDto(null, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
$surcharges = $bookingDto->booking->getSurchargesForParticipant($index);
|
|
||||||
$surchargeTotal = 0.0;
|
$surchargeTotal = 0.0;
|
||||||
|
|
||||||
foreach ($surcharges as $surcharge) {
|
foreach ($surcharges as $surcharge) {
|
||||||
|
|||||||
Reference in new issue
Block a user