Code Duplication    Length = 14-16 lines in 4 locations

src/Eccube/Controller/Admin/Product/CategoryController.php 1 location

@@ 233-247 (lines=15) @@
230
     * @Method("POST")
231
     * @Route("/{_admin}/product/category/sort_no/move", name="admin_product_category_sort_no_move")
232
     */
233
    public function moveSortNo(Application $app, Request $request)
234
    {
235
        if ($request->isXmlHttpRequest()) {
236
            $sortNos = $request->request->all();
237
            foreach ($sortNos as $categoryId => $sortNo) {
238
                /* @var $Category \Eccube\Entity\Category */
239
                $Category = $this->categoryRepository
240
                    ->find($categoryId);
241
                $Category->setSortNo($sortNo);
242
                $this->entityManager->persist($Category);
243
            }
244
            $this->entityManager->flush();
245
        }
246
        return true;
247
    }
248
249
250
    /**

src/Eccube/Controller/Admin/Product/ClassCategoryController.php 1 location

@@ 258-271 (lines=14) @@
255
     * @Method("POST")
256
     * @Route("/product/class_category/sort_no/move", name="admin_product_class_category_sort_no_move")
257
     */
258
    public function moveSortNo(Application $app, Request $request)
259
    {
260
        if ($request->isXmlHttpRequest()) {
261
            $sortNos = $request->request->all();
262
            foreach ($sortNos as $categoryId => $sortNo) {
263
                $ClassCategory = $this->classCategoryRepository
264
                    ->find($categoryId);
265
                $ClassCategory->setSortNo($sortNo);
266
                $this->entityManager->persist($ClassCategory);
267
            }
268
            $this->entityManager->flush();
269
        }
270
        return true;
271
    }
272
}
273

src/Eccube/Controller/Admin/Product/ClassNameController.php 1 location

@@ 170-184 (lines=15) @@
167
     * @Method("POST")
168
     * @Route("/{_admin}/product/class_name/sort_no/move", name="admin_product_class_name_sort_no_move")
169
     */
170
    public function moveSortNo(Application $app, Request $request)
171
    {
172
        if ($request->isXmlHttpRequest()) {
173
            $sortNos = $request->request->all();
174
            foreach ($sortNos as $classNameId => $sortNo) {
175
                $ClassName = $this->classNameRepository
176
                    ->find($classNameId);
177
                $ClassName->setSortNo($sortNo);
178
                $this->entityManager->persist($ClassName);
179
            }
180
            $this->entityManager->flush();
181
        }
182
183
        return true;
184
    }
185
}
186

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

@@ 333-348 (lines=16) @@
330
     * @Method("POST")
331
     * @Route("/{_admin}/setting/shop/delivery/sort_no/move", name="admin_setting_shop_delivery_sort_no_move")
332
     */
333
    public function moveSortNo(Application $app, Request $request)
334
    {
335
        if (!$request->isXmlHttpRequest()) {
336
            throw new BadRequestHttpException();
337
        }
338
339
        $sortNos = $request->request->all();
340
        foreach ($sortNos as $deliveryId => $sortNo) {
341
            $Delivery = $this->deliveryRepository
342
                ->find($deliveryId);
343
            $Delivery->setSortNo($sortNo);
344
        }
345
        $this->entityManager->flush();
346
347
        return true;
348
    }
349
}
350