Code Duplication    Length = 7-7 lines in 2 locations

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

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

src/Eccube/Controller/ShoppingController.php 1 location

@@ 397-403 (lines=7) @@
394
    {
395
        // 配送先住所最大値判定
396
        $Customer = $app->user();
397
        if ($app->isGranted('IS_AUTHENTICATED_FULLY')) {
398
            $addressCurrNum = count($app->user()->getCustomerAddresses());
399
            $addressMax = $this->appConfig['deliv_addr_max'];
400
            if ($addressCurrNum >= $addressMax) {
401
                throw new NotFoundHttpException('配送先住所最大数エラー');
402
            }
403
        }
404
405
        // カートチェック
406
        $response = $app->forward($app->path("shopping_check_to_cart"));