Code Duplication    Length = 14-16 lines in 2 locations

src/Eccube/Controller/Admin/Product/ProductClassController.php 2 locations

@@ 315-328 (lines=14) @@
312
                    $addProductClasses = array();
313
314
                    $tmpProductClass = null;
315
                    foreach ($form->get('product_classes') as $formData) {
316
                        // 追加対象の行をvalidate
317
                        $ProductClass = $formData->getData();
318
319
                        if ($ProductClass->getAdd()) {
320
                            if ($formData->isValid()) {
321
                                $addProductClasses[] = $ProductClass;
322
                            } else {
323
                                // 対象行のエラー
324
                                return $this->render($app, $Product, $ProductClass, true, $form);
325
                            }
326
                        }
327
                        $tmpProductClass = $ProductClass;
328
                    }
329
330
                    if (count($addProductClasses) == 0) {
331
                        // 対象がなければエラー
@@ 372-387 (lines=16) @@
369
                    $removeProductClasses = array();
370
371
                    $tempProductClass = null;
372
                    foreach ($form->get('product_classes') as $formData) {
373
                        // 追加対象の行をvalidate
374
                        $ProductClass = $formData->getData();
375
376
                        if ($ProductClass->getAdd()) {
377
                            if ($formData->isValid()) {
378
                                $checkProductClasses[] = $ProductClass;
379
                            } else {
380
                                return $this->render($app, $Product, $ProductClass, false, $form);
381
                            }
382
                        } else {
383
                            // 削除対象の行
384
                            $removeProductClasses[] = $ProductClass;
385
                        }
386
                        $tempProductClass = $ProductClass;
387
                    }
388
389
                    if (count($checkProductClasses) == 0) {
390
                        // 対象がなければエラー