Code Duplication    Length = 6-6 lines in 4 locations

src/Eccube/Controller/ShoppingController.php 4 locations

@@ 116-121 (lines=6) @@
113
        $flowResult = $this->validatePurchaseFlow($Order);
114
        $this->entityManager->flush();
115
116
        if ($flowResult->hasWarning() || $flowResult->hasError()) {
117
            log_info('[注文手続] WarningもしくはErrorが発生したためカート画面へ遷移します.',
118
                [$flowResult->getWarning(), $flowResult->getErrors()]);
119
120
            return $this->redirectToRoute('cart');
121
        }
122
123
        $form = $this->createForm(OrderType::class, $Order);
124
@@ 181-186 (lines=6) @@
178
            $flowResult = $this->validatePurchaseFlow($Order);
179
            $this->entityManager->flush();
180
181
            if ($flowResult->hasWarning() || $flowResult->hasError()) {
182
                log_info('[リダイレクト] WarningもしくはErrorが発生したためカート画面へ遷移します.',
183
                    [$flowResult->getWarning(), $flowResult->getErrors()]);
184
185
                return $this->redirectToRoute('shopping_error');
186
            }
187
188
            $redirectTo = $form['redirect_to']->getData();
189
            if (empty($redirectTo)) {
@@ 258-263 (lines=6) @@
255
            $flowResult = $this->validatePurchaseFlow($Order);
256
            $this->entityManager->flush();
257
258
            if ($flowResult->hasWarning() || $flowResult->hasError()) {
259
                log_info('[注文確認] WarningもしくはErrorが発生したためカート画面へ遷移します.',
260
                    [$flowResult->getWarning(), $flowResult->getErrors()]);
261
262
                return $this->redirectToRoute('shopping_error');
263
            }
264
265
            log_info('[注文確認] PaymentMethod::verifyを実行します.', [$Order->getPayment()->getMethodClass()]);
266
            $paymentMethod = $this->createPaymentMethod($Order, $form);
@@ 353-358 (lines=6) @@
350
                $flowResult = $this->validatePurchaseFlow($Order);
351
                $this->entityManager->flush();
352
353
                if ($flowResult->hasWarning() || $flowResult->hasError()) {
354
                    log_info('[注文処理] WarningもしくはErrorが発生したためカート画面へ遷移します.', [$flowResult->getWarning(), $flowResult->getErrors()]);
355
356
                    return $this->redirectToRoute('shopping_error');
357
                }
358
359
                /*
360
                 * 決済実行(前処理)
361
                 */