Code Duplication    Length = 19-19 lines in 2 locations

src/Eccube/Controller/Admin/Customer/CustomerDeliveryEditController.php 1 location

@@ 53-71 (lines=19) @@
50
    {
51
        // 配送先住所最大値判定
52
        // $idが存在する際は、追加処理ではなく、編集の処理ため本ロジックスキップ
53
        if (is_null($did)) {
54
            $addressCurrNum = count($Customer->getCustomerAddresses());
55
            $addressMax = $this->eccubeConfig['eccube_deliv_addr_max'];
56
            if ($addressCurrNum >= $addressMax) {
57
                throw new NotFoundHttpException();
58
            }
59
            $CustomerAddress = new CustomerAddress();
60
            $CustomerAddress->setCustomer($Customer);
61
        } else {
62
            $CustomerAddress = $this->customerAddressRepository->findOneBy(
63
                [
64
                    'id' => $did,
65
                    'Customer' => $Customer,
66
                ]
67
            );
68
            if (!$CustomerAddress) {
69
                throw new NotFoundHttpException();
70
            }
71
        }
72
73
        $builder = $this->formFactory
74
            ->createBuilder(CustomerAddressType::class, $CustomerAddress);

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

@@ 76-94 (lines=19) @@
73
74
        // 配送先住所最大値判定
75
        // $idが存在する際は、追加処理ではなく、編集の処理ため本ロジックスキップ
76
        if (is_null($id)) {
77
            $addressCurrNum = count($Customer->getCustomerAddresses());
78
            $addressMax = $this->eccubeConfig['eccube_deliv_addr_max'];
79
            if ($addressCurrNum >= $addressMax) {
80
                throw new NotFoundHttpException();
81
            }
82
            $CustomerAddress = new CustomerAddress();
83
            $CustomerAddress->setCustomer($Customer);
84
        } else {
85
            $CustomerAddress = $this->customerAddressRepository->findOneBy(
86
                [
87
                    'id' => $id,
88
                    'Customer' => $Customer,
89
                ]
90
            );
91
            if (!$CustomerAddress) {
92
                throw new NotFoundHttpException();
93
            }
94
        }
95
96
        $parentPage = $request->get('parent_page', null);
97