$bookingCreateDto->currentStep) { $this->addFlash('error', 'Bitte erst die vorherigen Schritte abschließen.'); return $this->redirectToCurrentStep($bookingCreateDto); } return null; } /** * Redirects to the current step based on the DTO's currentStep. */ private function redirectToCurrentStep(BookingCreateDto $bookingCreateDto): RedirectResponse { $route = match ($bookingCreateDto->currentStep) { 2 => 'app_booking_create_step_2', 3 => 'app_booking_create_step_3', default => 'app_booking_create_step_1', }; return $this->redirectToRoute($route); } }