Code Duplication    Length = 18-19 lines in 3 locations

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

@@ 148-165 (lines=18) @@
145
146
        $status = $app['eccube.repository.category']->delete($TargetCategory);
147
148
        if ($status === true) {
149
150
            log_info('カテゴリ削除完了', array($id));
151
152
            $event = new EventArgs(
153
                array(
154
                    'Parent' => $Parent,
155
                    'TargetCategory' => $TargetCategory,
156
                ),
157
                $request
158
            );
159
            $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_PRODUCT_CATEGORY_DELETE_COMPLETE, $event);
160
161
            $app->addSuccess('admin.category.delete.complete', 'admin');
162
        } else {
163
            log_info('カテゴリ削除エラー', array($id));
164
            $app->addError('admin.category.delete.error', 'admin');
165
        }
166
167
        if ($Parent) {
168
            return $app->redirect($app->url('admin_product_category_show', array('parent_id' => $Parent->getId())));

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

@@ 137-155 (lines=19) @@
134
        } else {
135
            $status = $app['eccube.repository.class_category']->delete($TargetClassCategory);
136
137
            if ($status === true) {
138
139
                log_info('規格分類削除完了', array($id));
140
141
                $event = new EventArgs(
142
                    array(
143
                        'ClassName' => $ClassName,
144
                        'TargetClassCategory' => $TargetClassCategory,
145
                    ),
146
                    $request
147
                );
148
                $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_PRODUCT_CLASS_CATEGORY_DELETE_COMPLETE, $event);
149
150
                $app->addSuccess('admin.class_category.delete.complete', 'admin');
151
            } else {
152
                log_info('規格分類削除エラー', array($id));
153
154
                $app->addError('admin.class_category.delete.error', 'admin');
155
            }
156
        }
157
158
        return $app->redirect($app->url('admin_product_class_category', array('class_name_id' => $ClassName->getId())));

src/Eccube/Controller/Mypage/DeliveryController.php 1 location

@@ 154-171 (lines=18) @@
151
152
        $status = $app['eccube.repository.customer_address']->deleteByCustomerAndId($Customer, $id);
153
154
        if ($status) {
155
            $event = new EventArgs(
156
                array(
157
                    'id' => $id,
158
                    'Customer' => $Customer,
159
                ), $request
160
            );
161
            $app['eccube.event.dispatcher']->dispatch(EccubeEvents::FRONT_MYPAGE_DELIVERY_DELETE_COMPLETE, $event);
162
163
            $app->addSuccess('mypage.address.delete.complete');
164
165
            log_info('お届け先削除完了', array($id));
166
167
        } else {
168
            $app->addError('mypage.address.delete.failed');
169
170
            log_info('お届け先削除失敗', array($id));
171
        }
172
173
        return $app->redirect($app->url('mypage_delivery'));
174
    }