Code Duplication    Length = 32-32 lines in 2 locations

src/Eccube/Controller/ShoppingController.php 2 locations

@@ 165-196 (lines=32) @@
162
     * @Route("/shopping/redirect", name="shopping_redirect_to")
163
     * @Template("Shopping/index.twig")
164
     */
165
    public function redirectTo(Request $request)
166
    {
167
        // カートチェック
168
        $response = $this->forwardToRoute('shopping_check_to_cart');
169
        if ($response->isRedirection() || $response->getContent()) {
170
            return $response;
171
        }
172
173
        // 受注の存在チェック
174
        $response = $this->forwardToRoute('shopping_exists_order');
175
        if ($response->isRedirection() || $response->getContent()) {
176
            return $response;
177
        }
178
179
        // フォームの生成
180
        $this->forwardToRoute('shopping_create_form');
181
        $form = $this->parameterBag->get(OrderType::class);
182
        $form->handleRequest($request);
183
184
        // 各種変更ページへリダイレクトする
185
        $response = $this->forwardToRoute('shopping_redirect_to_change');
186
        if ($response->isRedirection() || $response->getContent()) {
187
            return $response;
188
        }
189
        $form = $this->parameterBag->get(OrderType::class);
190
        $Order = $this->parameterBag->get('Order');
191
192
        return [
193
            'form' => $form->createView(),
194
            'Order' => $Order,
195
        ];
196
    }
197
198
    /**
199
     * 購入処理
@@ 205-236 (lines=32) @@
202
     * @Method("POST")
203
     * @Template("Shopping/confirm.twig")
204
     */
205
    public function confirm(Request $request)
206
    {
207
        // カートチェック
208
        $response = $this->forwardToRoute('shopping_check_to_cart');
209
        if ($response->isRedirection() || $response->getContent()) {
210
            return $response;
211
        }
212
213
        // 受注の存在チェック
214
        $response = $this->forwardToRoute('shopping_exists_order');
215
        if ($response->isRedirection() || $response->getContent()) {
216
            return $response;
217
        }
218
219
        // フォームの生成
220
        $this->forwardToRoute('shopping_create_form');
221
        $form = $this->parameterBag->get(OrderType::class);
222
        $form->handleRequest($request);
223
224
        $form = $this->parameterBag->get(OrderType::class);
225
        $Order = $this->parameterBag->get('Order');
226
227
        $flowResult = $this->executePurchaseFlow($Order);
228
        if ($flowResult->hasWarning() || $flowResult->hasError()) {
229
            return $this->redirectToRoute('shopping_error');
230
        }
231
232
        return [
233
            'form' => $form->createView(),
234
            'Order' => $Order,
235
        ];
236
    }
237
238
    /**
239
     * 購入処理