Code Duplication    Length = 24-25 lines in 2 locations

src/Eccube/Controller/Admin/Product/CategoryController.php 1 location

@@ 91-115 (lines=25) @@
88
                log_info('カテゴリ登録開始', array($id));
89
                $status = $app['eccube.repository.category']->save($TargetCategory);
90
91
                if ($status) {
92
93
                    log_info('カテゴリ登録完了', array($id));
94
95
                    $event = new EventArgs(
96
                        array(
97
                            'form' => $form,
98
                            'Parent' => $Parent,
99
                            'TargetCategory' => $TargetCategory,
100
                        ),
101
                        $request
102
                    );
103
                    $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_PRODUCT_CATEGORY_INDEX_COMPLETE, $event);
104
105
                    $app->addSuccess('admin.category.save.complete', 'admin');
106
107
                    if ($Parent) {
108
                        return $app->redirect($app->url('admin_product_category_show', array('parent_id' => $Parent->getId())));
109
                    } else {
110
                        return $app->redirect($app->url('admin_product_category'));
111
                    }
112
                } else {
113
                    log_info('カテゴリ登録エラー', array($id));
114
                    $app->addError('admin.category.save.error', 'admin');
115
                }
116
            }
117
        }
118

src/Eccube/Controller/Admin/Product/ClassNameController.php 1 location

@@ 63-86 (lines=24) @@
60
61
        if ($request->getMethod() === 'POST') {
62
            $form->handleRequest($request);
63
            if ($form->isValid()) {
64
                log_info('商品規格登録開始', array($id));
65
                $status = $app['eccube.repository.class_name']->save($TargetClassName);
66
67
                if ($status) {
68
                    log_info('商品規格登録完了', array($id));
69
70
                    $event = new EventArgs(
71
                        array(
72
                            'form' => $form,
73
                            'TargetClassName' => $TargetClassName,
74
                        ),
75
                        $request
76
                    );
77
                    $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_PRODUCT_CLASS_NAME_INDEX_COMPLETE, $event);
78
79
                    $app->addSuccess('admin.class_name.save.complete', 'admin');
80
81
                    return $app->redirect($app->url('admin_product_class_name'));
82
                } else {
83
                    log_info('商品規格登録エラー', array($id));
84
                    $app->addError('admin.class_name.save.error', 'admin');
85
                }
86
            }
87
        }
88
89
        $ClassNames = $app['eccube.repository.class_name']->getList();