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

@@ 340-346 (lines=7) @@
337
    {
338
        // 配送先住所最大値判定
339
        $Customer = $app->user();
340
        if ($app->isGranted('IS_AUTHENTICATED_FULLY')) {
341
            $addressCurrNum = count($app->user()->getCustomerAddresses());
342
            $addressMax = $app['config']['deliv_addr_max'];
343
            if ($addressCurrNum >= $addressMax) {
344
                throw new NotFoundHttpException('配送先住所最大数エラー');
345
            }
346
        }
347
348
        // カートチェック
349
        $response = $app->forward($app->path("shopping/checkToCart"));