Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 66-72 (lines=7) @@
63
64
        // 配送先住所最大値判定
65
        // $idが存在する際は、追加処理ではなく、編集の処理ため本ロジックスキップ
66
        if (is_null($id)) {
67
            $addressCurrNum = count($Customer->getCustomerAddresses());
68
            $addressMax = $app['config']['deliv_addr_max'];
69
            if ($addressCurrNum >= $addressMax) {
70
                throw new NotFoundHttpException('お届け先の登録数の上限を超えています');
71
            }
72
        }
73
74
        $CustomerAddress = $app['eccube.repository.customer_address']->findOrCreateByCustomerAndId($Customer, $id);
75

src/Eccube/Controller/ShoppingController.php 1 location

@@ 316-322 (lines=7) @@
313
    {
314
        // 配送先住所最大値判定
315
        $Customer = $app->user();
316
        if ($app->isGranted('IS_AUTHENTICATED_FULLY')) {
317
            $addressCurrNum = count($app->user()->getCustomerAddresses());
318
            $addressMax = $app['config']['deliv_addr_max'];
319
            if ($addressCurrNum >= $addressMax) {
320
                throw new NotFoundHttpException('配送先住所最大数エラー');
321
            }
322
        }
323
324
        // カートチェック
325
        $response = $app->forward($app->path("shopping/checkToCart"));