Code Duplication    Length = 13-15 lines in 2 locations

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

@@ 419-431 (lines=13) @@
416
                                    if (isset($row[$headerByKey['class_category2']]) && StringUtil::isNotBlank($row[$headerByKey['class_category2']])) {
417
                                        if (preg_match('/^\d+$/', $row[$headerByKey['class_category2']])) {
418
                                            $ClassCategory2 = $this->classCategoryRepository->find($row[$headerByKey['class_category2']]);
419
                                            if (!$ClassCategory2) {
420
                                                $message = trans('admin.common.csv_invalid_not_found', ['%line%' => $line, '%name%' => $headerByKey['class_category2']]);
421
                                                $this->addErrors($message);
422
                                            } else {
423
                                                if ($ClassCategory1 &&
424
                                                    ($ClassCategory1->getClassName()->getId() == $ClassCategory2->getClassName()->getId())
425
                                                ) {
426
                                                    $message = trans('admin.common.csv_invalid_not_same', ['%line%' => $line, '%name1%' => $headerByKey['class_category1'], '%name2%' => $headerByKey['class_category2']]);
427
                                                    $this->addErrors($message);
428
                                                } else {
429
                                                    $ProductClass->setClassCategory2($ClassCategory2);
430
                                                }
431
                                            }
432
                                        } else {
433
                                            $message = trans('admin.common.csv_invalid_not_found', ['%line%' => $line, '%name%' => $headerByKey['class_category2']]);
434
                                            $this->addErrors($message);
@@ 555-569 (lines=15) @@
552
                                        } else {
553
                                            if (preg_match('/^\d+$/', $classCategoryId2)) {
554
                                                $ClassCategory2 = $this->classCategoryRepository->find($classCategoryId2);
555
                                                if (!$ClassCategory2) {
556
                                                    $message = trans('admin.common.csv_invalid_not_found', ['%line%' => $line, '%name%' => $headerByKey['class_category2']]);
557
                                                    $this->addErrors($message);
558
                                                } else {
559
                                                    if ($ClassCategory1 &&
560
                                                        ($ClassCategory1->getClassName()->getId() == $ClassCategory2->getClassName()->getId())
561
                                                    ) {
562
                                                        $message = trans('admin.common.csv_invalid_not_same', [
563
                                                            '%line%' => $line,
564
                                                            '%name1%' => $headerByKey['class_category1'],
565
                                                            '%name2%' => $headerByKey['class_category2'],
566
                                                        ]);
567
                                                        $this->addErrors($message);
568
                                                    }
569
                                                }
570
                                            } else {
571
                                                $message = trans('admin.common.csv_invalid_not_found', ['%line%' => $line, '%name%' => $headerByKey['class_category2']]);
572
                                                $this->addErrors($message);