Code Duplication    Length = 5-5 lines in 6 locations

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

@@ 219-223 (lines=5) @@
216
                            $Product->setName(StringUtil::trimAll($row[$headerByKey['name']]));
217
                        }
218
219
                        if (isset($row[$headerByKey['note']]) && StringUtil::isNotBlank($row[$headerByKey['note']])) {
220
                            $Product->setNote(StringUtil::trimAll($row[$headerByKey['note']]));
221
                        } else {
222
                            $Product->setNote(null);
223
                        }
224
225
                        if (isset($row[$headerByKey['description_list']]) && StringUtil::isNotBlank($row[$headerByKey['description_list']])) {
226
                            $Product->setDescriptionList(StringUtil::trimAll($row[$headerByKey['description_list']]));
@@ 225-229 (lines=5) @@
222
                            $Product->setNote(null);
223
                        }
224
225
                        if (isset($row[$headerByKey['description_list']]) && StringUtil::isNotBlank($row[$headerByKey['description_list']])) {
226
                            $Product->setDescriptionList(StringUtil::trimAll($row[$headerByKey['description_list']]));
227
                        } else {
228
                            $Product->setDescriptionList(null);
229
                        }
230
231
                        if (isset($row[$headerByKey['description_detail']]) && StringUtil::isNotBlank($row[$headerByKey['description_detail']])) {
232
                            $Product->setDescriptionDetail(StringUtil::trimAll($row[$headerByKey['description_detail']]));
@@ 231-235 (lines=5) @@
228
                            $Product->setDescriptionList(null);
229
                        }
230
231
                        if (isset($row[$headerByKey['description_detail']]) && StringUtil::isNotBlank($row[$headerByKey['description_detail']])) {
232
                            $Product->setDescriptionDetail(StringUtil::trimAll($row[$headerByKey['description_detail']]));
233
                        } else {
234
                            $Product->setDescriptionDetail(null);
235
                        }
236
237
                        if (isset($row[$headerByKey['search_word']]) && StringUtil::isNotBlank($row[$headerByKey['search_word']])) {
238
                            $Product->setSearchWord(StringUtil::trimAll($row[$headerByKey['search_word']]));
@@ 237-241 (lines=5) @@
234
                            $Product->setDescriptionDetail(null);
235
                        }
236
237
                        if (isset($row[$headerByKey['search_word']]) && StringUtil::isNotBlank($row[$headerByKey['search_word']])) {
238
                            $Product->setSearchWord(StringUtil::trimAll($row[$headerByKey['search_word']]));
239
                        } else {
240
                            $Product->setSearchWord(null);
241
                        }
242
243
                        if (isset($row[$headerByKey['free_area']]) && StringUtil::isNotBlank($row[$headerByKey['free_area']])) {
244
                            $Product->setFreeArea(StringUtil::trimAll($row[$headerByKey['free_area']]));
@@ 243-247 (lines=5) @@
240
                            $Product->setSearchWord(null);
241
                        }
242
243
                        if (isset($row[$headerByKey['free_area']]) && StringUtil::isNotBlank($row[$headerByKey['free_area']])) {
244
                            $Product->setFreeArea(StringUtil::trimAll($row[$headerByKey['free_area']]));
245
                        } else {
246
                            $Product->setFreeArea(null);
247
                        }
248
249
                        // 商品画像登録
250
                        $this->createProductImage($row, $Product, $data, $headerByKey);
@@ 901-905 (lines=5) @@
898
            }
899
        }
900
901
        if (isset($row[$headerByKey['product_code']]) && StringUtil::isNotBlank($row[$headerByKey['product_code']])) {
902
            $ProductClass->setCode(StringUtil::trimAll($row[$headerByKey['product_code']]));
903
        } else {
904
            $ProductClass->setCode(null);
905
        }
906
907
        if (StringUtil::isBlank($row[$headerByKey['stock_unlimited']])) {
908
            $message = trans('csvimportcontroller.require', ['%line%' => $line, '%name%' => $headerByKey['stock_unlimited']]);