chore: cleanup
This commit is contained in:
@@ -147,38 +147,6 @@ class ParticipantRentalsFieldHandler extends AbstractParticipantFieldHandler
|
||||
return $ageEvaluator->isServiceAvailableForParticipant($service, $bookingDto, $participantIndex);
|
||||
}
|
||||
|
||||
private function findServiceInAvailableServices(mixed $selectedService, array $availableServices): ?Service
|
||||
{
|
||||
foreach ($availableServices as $availableService) {
|
||||
if ($this->servicesMatch($selectedService, $availableService)) {
|
||||
return $availableService;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private function servicesMatch(mixed $selectedService, Service $availableService): bool
|
||||
{
|
||||
if ($selectedService === $availableService) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ($selectedService instanceof Service) {
|
||||
return $selectedService->id === $availableService->id;
|
||||
}
|
||||
|
||||
if (is_numeric($selectedService)) {
|
||||
return (int) $selectedService === $availableService->id;
|
||||
}
|
||||
|
||||
if (is_string($selectedService)) {
|
||||
return $selectedService === (string) $availableService->id;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters rentals to only include those matching the skipass duration.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user