Code Duplication    Length = 12-13 lines in 2 locations

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

@@ 750-762 (lines=13) @@
747
            $message = trans('admin.common.delete_error');
748
        }
749
750
        if ($request->isXmlHttpRequest()) {
751
            return $this->json(['success' => $success, 'message' => $message]);
752
        } else {
753
            if ($success) {
754
                $this->addSuccess($message, 'admin');
755
            } else {
756
                $this->addError($message, 'admin');
757
            }
758
759
            $rUrl = $this->generateUrl('admin_product_page', ['page_no' => $page_no]).'?resume='.Constant::ENABLED;
760
761
            return $this->redirect($rUrl);
762
        }
763
    }
764
765
    /**
@@ 687-698 (lines=12) @@
684
        if (!is_null($id)) {
685
            /* @var $Product \Eccube\Entity\Product */
686
            $Product = $this->productRepository->find($id);
687
            if (!$Product) {
688
                if ($request->isXmlHttpRequest()) {
689
                    $message = trans('admin.common.delete_error_already_deleted');
690
691
                    return $this->json(['success' => $success, 'message' => $message]);
692
                } else {
693
                    $this->deleteMessage();
694
                    $rUrl = $this->generateUrl('admin_product_page', ['page_no' => $page_no]).'?resume='.Constant::ENABLED;
695
696
                    return $this->redirect($rUrl);
697
                }
698
            }
699
700
            if ($Product instanceof Product) {
701
                log_info('商品削除開始', [$id]);