chore: cleanup

This commit is contained in:
Björn Fromme
2026-03-16 11:59:12 +01:00
parent 400407358d
commit 36ef54d541
6 changed files with 62 additions and 231 deletions
@@ -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;
}
}