Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 115-121 (lines=7) @@
112
113
        // 配送先住所最大値判定
114
        // $idが存在する際は、追加処理ではなく、編集の処理ため本ロジックスキップ
115
        if (is_null($id)) {
116
            $addressCurrNum = count($Customer->getCustomerAddresses());
117
            $addressMax = $this->appConfig['deliv_addr_max'];
118
            if ($addressCurrNum >= $addressMax) {
119
                throw new NotFoundHttpException('お届け先の登録数の上限を超えています');
120
            }
121
        }
122
123
        $CustomerAddress = $this->customerAddressRepository->findOrCreateByCustomerAndId($Customer, $id);
124

src/Eccube/Controller/ShoppingController.php 1 location

@@ 439-445 (lines=7) @@
436
    {
437
        // 配送先住所最大値判定
438
        $Customer = $app->user();
439
        if ($app->isGranted('IS_AUTHENTICATED_FULLY')) {
440
            $addressCurrNum = count($app->user()->getCustomerAddresses());
441
            $addressMax = $this->appConfig['deliv_addr_max'];
442
            if ($addressCurrNum >= $addressMax) {
443
                throw new NotFoundHttpException('配送先住所最大数エラー');
444
            }
445
        }
446
447
        // カートチェック
448
        $response = $app->forward($app->path("shopping_check_to_cart"));