Code Duplication    Length = 19-20 lines in 2 locations

src/Eccube/Controller/Admin/Setting/Shop/ShopController.php 1 location

@@ 103-122 (lines=20) @@
100
        $form = $builder->getForm();
101
        $form->handleRequest($request);
102
103
        if ($form->isSubmitted()) {
104
            if ($form->isValid()) {
105
                $this->entityManager->persist($this->BaseInfo);
106
                $this->entityManager->flush();
107
108
                $event = new EventArgs(
109
                    array(
110
                        'form' => $form,
111
                        'BaseInfo' => $this->BaseInfo,
112
                    ),
113
                    $request
114
                );
115
                $this->eventDispatcher->dispatch(EccubeEvents::ADMIN_SETTING_SHOP_SHOP_INDEX_COMPLETE, $event);
116
117
                $app->addSuccess('admin.shop.save.complete', 'admin');
118
119
                return $app->redirect($app->url('admin_setting_shop'));
120
            }
121
            $app->addError('admin.shop.save.error', 'admin');
122
        }
123
124
        $this->twigEnvironment->addGlobal('BaseInfo', $CloneInfo);
125

src/Eccube/Controller/Admin/Setting/Shop/TaxRuleController.php 1 location

@@ 128-146 (lines=19) @@
125
        $form = $builder->getForm();
126
        $form->handleRequest($request);
127
128
        if ($form->isSubmitted() && $this->isValid($form)) {
129
130
            $this->entityManager->persist($TargetTaxRule);
131
            $this->entityManager->flush();
132
133
            $event = new EventArgs(
134
                array(
135
                    'form' => $form,
136
                    'BaseInfo' => $this->BaseInfo,
137
                    'TargetTaxRule' => $TargetTaxRule,
138
                ),
139
                $request
140
            );
141
            $this->eventDispatcher->dispatch(EccubeEvents::ADMIN_SETTING_SHOP_TAX_RULE_INDEX_COMPLETE, $event);
142
143
            $app->addSuccess('admin.shop.tax.save.complete', 'admin');
144
145
            return $app->redirect($app->url('admin_setting_shop_tax'));
146
        }
147
148
        // 共通税率一覧
149
        $TaxRules = $this->taxRuleRepository->getList();