Code Duplication    Length = 11-14 lines in 2 locations

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

@@ 726-736 (lines=11) @@
723
724
                    // 画像ファイルの削除(commit後に削除させる)
725
                    /** @var ProductImage $deleteImage */
726
                    foreach ($deleteImages as $deleteImage) {
727
                        if ($this->productImageRepository->findOneBy(['file_name' => $deleteImage->getFileName()])) {
728
                            continue;
729
                        }
730
                        try {
731
                            $fs = new Filesystem();
732
                            $fs->remove($this->eccubeConfig['eccube_save_image_dir'].'/'.$deleteImage);
733
                        } catch (\Exception $e) {
734
                            // エラーが発生しても無視する
735
                        }
736
                    }
737
738
                    log_info('商品削除完了', [$id]);
739

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

@@ 654-667 (lines=14) @@
651
                    $this->entityManager->getConnection()->commit();
652
653
                    // 画像ファイルの削除(commit後に削除させる)
654
                    foreach ($deleteImages as $images) {
655
                        /** @var ProductImage $image */
656
                        foreach ($images as $image) {
657
                            if ($this->productImageRepository->findOneBy(['file_name' => $image->getFileName()])) {
658
                                continue;
659
                            }
660
                            try {
661
                                $fs = new Filesystem();
662
                                $fs->remove($this->eccubeConfig['eccube_save_image_dir'].'/'.$image);
663
                            } catch (\Exception $e) {
664
                                // エラーが発生しても無視する
665
                            }
666
                        }
667
                    }
668
669
                    log_info('商品CSV登録完了');
670
                    if (!$this->isSplitCsv) {