chore: cleanup

This commit is contained in:
Björn Fromme committed 2025-12-07 15:03:54 +01:00
1 parent 67491a7f68
commit 233748a6c5
6 files changed
+62 -231

No files matched your search

@@ -110,36 +110,4 @@ class ParticipantBoardFieldHandler 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;
}
}