Code Duplication    Length = 7-7 lines in 2 locations

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"));

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

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