Code Duplication    Length = 32-32 lines in 2 locations

src/Eccube/Controller/ShoppingController.php 2 locations

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