Reduce returns in OrderController::guest to 3
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -79,11 +79,9 @@ class OrderController extends AbstractController
|
||||
throw $this->createNotFoundException();
|
||||
}
|
||||
|
||||
if ($order->getUser()) {
|
||||
return $this->redirectToRoute('app_order_payment', ['id' => $order->getId()]);
|
||||
}
|
||||
$canSkip = $order->getUser();
|
||||
|
||||
if ($request->isMethod('POST')) {
|
||||
if ($request->isMethod('POST') && !$canSkip) {
|
||||
$firstName = trim($request->request->getString('first_name'));
|
||||
$lastName = trim($request->request->getString('last_name'));
|
||||
$email = trim($request->request->getString('email'));
|
||||
@@ -98,7 +96,10 @@ class OrderController extends AbstractController
|
||||
$order->setLastName($lastName);
|
||||
$order->setEmail($email);
|
||||
$em->flush();
|
||||
$canSkip = true;
|
||||
}
|
||||
|
||||
if ($canSkip) {
|
||||
return $this->redirectToRoute('app_order_payment', ['id' => $order->getId()]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user