Code Duplication    Length = 12-13 lines in 2 locations

src/Eccube/Controller/Admin/Product/ProductController.php 2 locations

@@ 670-681 (lines=12) @@
667
        if (!is_null($id)) {
668
            /* @var $Product \Eccube\Entity\Product */
669
            $Product = $this->productRepository->find($id);
670
            if (!$Product) {
671
                if ($request->isXmlHttpRequest()) {
672
                    $message = trans('admin.delete.warning');
673
674
                    return new JsonResponse(['success' => $success, 'message' => $message]);
675
                } else {
676
                    $this->deleteMessage();
677
                    $rUrl = $this->generateUrl('admin_product_page', ['page_no' => $page_no]).'?resume='.Constant::ENABLED;
678
679
                    return $this->redirect($rUrl);
680
                }
681
            }
682
683
            if ($Product instanceof Product) {
684
                log_info('商品削除開始', [$id]);
@@ 731-743 (lines=13) @@
728
            $message = trans('admin.delete.failed');
729
        }
730
731
        if ($request->isXmlHttpRequest()) {
732
            return new JsonResponse(['success' => $success, 'message' => $message]);
733
        } else {
734
            if ($success) {
735
                $this->addSuccess($message, 'admin');
736
            } else {
737
                $this->addError($message, 'admin');
738
            }
739
740
            $rUrl = $this->generateUrl('admin_product_page', ['page_no' => $page_no]).'?resume='.Constant::ENABLED;
741
742
            return $this->redirect($rUrl);
743
        }
744
    }
745
746
    /**