Completed
Pull Request — master (#2110)
by k-yamamura
50:42
created
src/Eccube/Controller/Admin/Product/CsvImportController.php 1 patch
Spacing   +82 added lines, -82 removed lines patch added patch discarded remove patch
@@ -108,7 +108,7 @@  discard block
 block discarded – undo
108 108
                     foreach ($data as $row) {
109 109
 
110 110
                         if ($headerSize != count($row)) {
111
-                            $this->addErrors(($data->key() + 1) . '行目のCSVフォーマットが一致しません。');
111
+                            $this->addErrors(($data->key() + 1).'行目のCSVフォーマットが一致しません。');
112 112
                             return $this->render($app, $form, $headers, $this->productTwig);
113 113
                         }
114 114
 
@@ -119,33 +119,33 @@  discard block
 block discarded – undo
119 119
                             if (preg_match('/^\d+$/', $row['商品ID'])) {
120 120
                                 $Product = $app['eccube.repository.product']->find($row['商品ID']);
121 121
                                 if (!$Product) {
122
-                                    $this->addErrors(($data->key() + 1) . '行目の商品IDが存在しません。');
122
+                                    $this->addErrors(($data->key() + 1).'行目の商品IDが存在しません。');
123 123
                                     return $this->render($app, $form, $headers, $this->productTwig);
124 124
                                 }
125 125
                             } else {
126
-                                $this->addErrors(($data->key() + 1) . '行目の商品IDが存在しません。');
126
+                                $this->addErrors(($data->key() + 1).'行目の商品IDが存在しません。');
127 127
                                 return $this->render($app, $form, $headers, $this->productTwig);
128 128
                             }
129 129
 
130 130
                         }
131 131
 
132 132
                         if ($row['公開ステータス(ID)'] == '') {
133
-                            $this->addErrors(($data->key() + 1) . '行目の公開ステータス(ID)が設定されていません。');
133
+                            $this->addErrors(($data->key() + 1).'行目の公開ステータス(ID)が設定されていません。');
134 134
                         } else {
135 135
                             if (preg_match('/^\d+$/', $row['公開ステータス(ID)'])) {
136 136
                                 $Disp = $app['eccube.repository.master.disp']->find($row['公開ステータス(ID)']);
137 137
                                 if (!$Disp) {
138
-                                    $this->addErrors(($data->key() + 1) . '行目の公開ステータス(ID)が存在しません。');
138
+                                    $this->addErrors(($data->key() + 1).'行目の公開ステータス(ID)が存在しません。');
139 139
                                 } else {
140 140
                                     $Product->setStatus($Disp);
141 141
                                 }
142 142
                             } else {
143
-                                $this->addErrors(($data->key() + 1) . '行目の公開ステータス(ID)が存在しません。');
143
+                                $this->addErrors(($data->key() + 1).'行目の公開ステータス(ID)が存在しません。');
144 144
                             }
145 145
                         }
146 146
 
147 147
                         if (Str::isBlank($row['商品名'])) {
148
-                            $this->addErrors(($data->key() + 1) . '行目の商品名が設定されていません。');
148
+                            $this->addErrors(($data->key() + 1).'行目の商品名が設定されていません。');
149 149
                             return $this->render($app, $form, $headers, $this->productTwig);
150 150
                         } else {
151 151
                             $Product->setName(Str::trimAll($row['商品名']));
@@ -184,10 +184,10 @@  discard block
 block discarded – undo
184 184
                         if ($row['商品削除フラグ'] == '') {
185 185
                             $Product->setDelFlg(Constant::DISABLED);
186 186
                         } else {
187
-                            if ($row['商品削除フラグ'] == (string)Constant::DISABLED || $row['商品削除フラグ'] == (string)Constant::ENABLED) {
187
+                            if ($row['商品削除フラグ'] == (string) Constant::DISABLED || $row['商品削除フラグ'] == (string) Constant::ENABLED) {
188 188
                                 $Product->setDelFlg($row['商品削除フラグ']);
189 189
                             } else {
190
-                                $this->addErrors(($data->key() + 1) . '行目の商品削除フラグが設定されていません。');
190
+                                $this->addErrors(($data->key() + 1).'行目の商品削除フラグが設定されていません。');
191 191
                                 return $this->render($app, $form, $headers, $this->productTwig);
192 192
                             }
193 193
                         }
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
                                     if (preg_match('/^\d+$/', $deliveryFee) && $deliveryFee >= 0) {
215 215
                                         $ProductClassOrg->setDeliveryFee($deliveryFee);
216 216
                                     } else {
217
-                                        $this->addErrors(($data->key() + 1) . '行目の送料は0以上の数値を設定してください。');
217
+                                        $this->addErrors(($data->key() + 1).'行目の送料は0以上の数値を設定してください。');
218 218
                                     }
219 219
                                 }
220 220
                             }
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
                             if ($row['規格分類1(ID)'] != '') {
223 223
 
224 224
                                 if ($row['規格分類1(ID)'] == $row['規格分類2(ID)']) {
225
-                                    $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)と規格分類2(ID)には同じ値を使用できません。');
225
+                                    $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)と規格分類2(ID)には同じ値を使用できません。');
226 226
                                 } else {
227 227
                                     // 商品規格あり
228 228
                                     // 企画分類あり商品を作成
@@ -237,30 +237,30 @@  discard block
 block discarded – undo
237 237
                                     if (preg_match('/^\d+$/', $row['規格分類1(ID)'])) {
238 238
                                         $ClassCategory1 = $app['eccube.repository.class_category']->find($row['規格分類1(ID)']);
239 239
                                         if (!$ClassCategory1) {
240
-                                            $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。');
240
+                                            $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。');
241 241
                                         } else {
242 242
                                             $ProductClass->setClassCategory1($ClassCategory1);
243 243
                                         }
244 244
                                     } else {
245
-                                        $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。');
245
+                                        $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。');
246 246
                                     }
247 247
 
248 248
                                     if ($row['規格分類2(ID)'] != '') {
249 249
                                         if (preg_match('/^\d+$/', $row['規格分類2(ID)'])) {
250 250
                                             $ClassCategory2 = $app['eccube.repository.class_category']->find($row['規格分類2(ID)']);
251 251
                                             if (!$ClassCategory2) {
252
-                                                $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。');
252
+                                                $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。');
253 253
                                             } else {
254 254
                                                 if ($ClassCategory1 &&
255 255
                                                     ($ClassCategory1->getClassName()->getId() == $ClassCategory2->getClassName()->getId())
256 256
                                                 ) {
257
-                                                    $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)と規格分類2(ID)の規格名が同じです。');
257
+                                                    $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)と規格分類2(ID)の規格名が同じです。');
258 258
                                                 } else {
259 259
                                                     $ProductClass->setClassCategory2($ClassCategory2);
260 260
                                                 }
261 261
                                             }
262 262
                                         } else {
263
-                                            $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。');
263
+                                            $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。');
264 264
                                         }
265 265
                                     }
266 266
                                     $ProductClass->setProductStock($ProductStock);
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
 
273 273
                             } else {
274 274
                                 if ($row['規格分類2(ID)'] != '') {
275
-                                    $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。');
275
+                                    $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。');
276 276
                                 }
277 277
                             }
278 278
 
@@ -300,7 +300,7 @@  discard block
 block discarded – undo
300 300
                                             if (preg_match('/^\d+$/', $deliveryFee) && $deliveryFee >= 0) {
301 301
                                                 $pc->setDeliveryFee($deliveryFee);
302 302
                                             } else {
303
-                                                $this->addErrors(($data->key() + 1) . '行目の送料は0以上の数値を設定してください。');
303
+                                                $this->addErrors(($data->key() + 1).'行目の送料は0以上の数値を設定してください。');
304 304
                                             }
305 305
                                         }
306 306
                                     }
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
                                 }
323 323
 
324 324
                                 if ($row['規格分類1(ID)'] == $row['規格分類2(ID)']) {
325
-                                    $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)と規格分類2(ID)には同じ値を使用できません。');
325
+                                    $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)と規格分類2(ID)には同じ値を使用できません。');
326 326
                                 } else {
327 327
 
328 328
                                     // 必ず規格分類1がセットされている
@@ -331,36 +331,36 @@  discard block
 block discarded – undo
331 331
                                     if (preg_match('/^\d+$/', $classCategoryId1)) {
332 332
                                         $ClassCategory1 = $app['eccube.repository.class_category']->find($classCategoryId1);
333 333
                                         if (!$ClassCategory1) {
334
-                                            $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。');
334
+                                            $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。');
335 335
                                         }
336 336
                                     } else {
337
-                                        $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。');
337
+                                        $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。');
338 338
                                     }
339 339
 
340 340
                                     $ClassCategory2 = null;
341 341
                                     if ($row['規格分類2(ID)'] != '') {
342 342
                                         if ($pc->getClassCategory1() != null && $pc->getClassCategory2() == null) {
343
-                                            $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)は設定できません。');
343
+                                            $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)は設定できません。');
344 344
                                         } else {
345 345
                                             if (preg_match('/^\d+$/', $classCategoryId2)) {
346 346
                                                 $ClassCategory2 = $app['eccube.repository.class_category']->find($classCategoryId2);
347 347
                                                 if (!$ClassCategory2) {
348
-                                                    $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。');
348
+                                                    $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。');
349 349
                                                 } else {
350 350
                                                     if ($ClassCategory1 &&
351 351
                                                         ($ClassCategory1->getClassName()->getId() == $ClassCategory2->getClassName()->getId())
352 352
                                                     ) {
353
-                                                        $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)と規格分類2(ID)の規格名が同じです。');
353
+                                                        $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)と規格分類2(ID)の規格名が同じです。');
354 354
                                                     }
355 355
                                                 }
356 356
                                             } else {
357
-                                                $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。');
357
+                                                $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。');
358 358
                                             }
359 359
 
360 360
                                         }
361 361
                                     } else {
362 362
                                         if ($pc->getClassCategory1() != null && $pc->getClassCategory2() != null) {
363
-                                            $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)に値を設定してください。');
363
+                                            $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)に値を設定してください。');
364 364
                                         }
365 365
                                     }
366 366
                                     $ProductClass = $this->createProductClass($row, $Product, $app, $data, $ClassCategory1, $ClassCategory2);
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
                                             if (preg_match('/^\d+$/', $deliveryFee) && $deliveryFee >= 0) {
372 372
                                                 $ProductClass->setDeliveryFee($deliveryFee);
373 373
                                             } else {
374
-                                                $this->addErrors(($data->key() + 1) . '行目の送料は0以上の数値を設定してください。');
374
+                                                $this->addErrors(($data->key() + 1).'行目の送料は0以上の数値を設定してください。');
375 375
                                             }
376 376
                                         }
377 377
                                     }
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
                     foreach ($data as $row) {
459 459
 
460 460
                         if ($headerSize != count($row)) {
461
-                            $this->addErrors(($data->key() + 1) . '行目のCSVフォーマットが一致しません。');
461
+                            $this->addErrors(($data->key() + 1).'行目のCSVフォーマットが一致しません。');
462 462
                             return $this->render($app, $form, $headers, $this->categoryTwig);
463 463
                         }
464 464
 
@@ -466,23 +466,23 @@  discard block
 block discarded – undo
466 466
                             $Category = new Category();
467 467
                         } else {
468 468
                             if (!preg_match('/^\d+$/', $row['カテゴリID'])) {
469
-                                $this->addErrors(($data->key() + 1) . '行目のカテゴリIDが存在しません。');
469
+                                $this->addErrors(($data->key() + 1).'行目のカテゴリIDが存在しません。');
470 470
                                 return $this->render($app, $form, $headers, $this->categoryTwig);
471 471
                             }
472 472
                             $Category = $app['eccube.repository.category']->find($row['カテゴリID']);
473 473
                             if (!$Category) {
474
-                                $this->addErrors(($data->key() + 1) . '行目のカテゴリIDが存在しません。');
474
+                                $this->addErrors(($data->key() + 1).'行目のカテゴリIDが存在しません。');
475 475
                                 return $this->render($app, $form, $headers, $this->categoryTwig);
476 476
                             }
477 477
                             if ($row['カテゴリID'] == $row['親カテゴリID']) {
478
-                                $this->addErrors(($data->key() + 1) . '行目のカテゴリIDと親カテゴリIDが同じです。');
478
+                                $this->addErrors(($data->key() + 1).'行目のカテゴリIDと親カテゴリIDが同じです。');
479 479
                                 return $this->render($app, $form, $headers, $this->categoryTwig);
480 480
                             }
481 481
 
482 482
                         }
483 483
 
484 484
                         if (Str::isBlank($row['カテゴリ名'])) {
485
-                            $this->addErrors(($data->key() + 1) . '行目のカテゴリ名が設定されていません。');
485
+                            $this->addErrors(($data->key() + 1).'行目のカテゴリ名が設定されていません。');
486 486
                             return $this->render($app, $form, $headers, $this->categoryTwig);
487 487
                         } else {
488 488
                             $Category->setName(Str::trimAll($row['カテゴリ名']));
@@ -491,13 +491,13 @@  discard block
 block discarded – undo
491 491
                         if ($row['親カテゴリID'] != '') {
492 492
 
493 493
                             if (!preg_match('/^\d+$/', $row['親カテゴリID'])) {
494
-                                $this->addErrors(($data->key() + 1) . '行目の親カテゴリIDが存在しません。');
494
+                                $this->addErrors(($data->key() + 1).'行目の親カテゴリIDが存在しません。');
495 495
                                 return $this->render($app, $form, $headers, $this->categoryTwig);
496 496
                             }
497 497
 
498 498
                             $ParentCategory = $app['eccube.repository.category']->find($row['親カテゴリID']);
499 499
                             if (!$ParentCategory) {
500
-                                $this->addErrors(($data->key() + 1) . '行目の親カテゴリIDが存在しません。');
500
+                                $this->addErrors(($data->key() + 1).'行目の親カテゴリIDが存在しません。');
501 501
                                 return $this->render($app, $form, $headers, $this->categoryTwig);
502 502
                             }
503 503
 
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
                         }
514 514
 
515 515
                         if ($app['config']['category_nest_level'] < $Category->getLevel()) {
516
-                            $this->addErrors(($data->key() + 1) . '行目のカテゴリが最大レベルを超えているため設定できません。');
516
+                            $this->addErrors(($data->key() + 1).'行目のカテゴリが最大レベルを超えているため設定できません。');
517 517
                             return $this->render($app, $form, $headers, $this->categoryTwig);
518 518
                         }
519 519
 
@@ -522,18 +522,18 @@  discard block
 block discarded – undo
522 522
                             $Category->setDelFlg(Constant::DISABLED);
523 523
                             $status = $app['eccube.repository.category']->save($Category);
524 524
                         } else {
525
-                            if ($row['カテゴリ削除フラグ'] == (string)Constant::DISABLED || $row['カテゴリ削除フラグ'] == (string)Constant::ENABLED) {
525
+                            if ($row['カテゴリ削除フラグ'] == (string) Constant::DISABLED || $row['カテゴリ削除フラグ'] == (string) Constant::ENABLED) {
526 526
                                 $Category->setDelFlg($row['カテゴリ削除フラグ']);
527 527
                             } else {
528
-                                $this->addErrors(($data->key() + 1) . '行目のカテゴリ削除フラグが設定されていません。');
528
+                                $this->addErrors(($data->key() + 1).'行目のカテゴリ削除フラグが設定されていません。');
529 529
                                 return $this->render($app, $form, $headers, $this->categoryTwig);
530 530
                             }
531 531
 
532
-                            if ($row['カテゴリ削除フラグ'] == (string)Constant::ENABLED) {
532
+                            if ($row['カテゴリ削除フラグ'] == (string) Constant::ENABLED) {
533 533
                                 $status = $app['eccube.repository.category']->delete($Category);
534 534
 
535 535
                                 if (!$status) {
536
-                                    $this->addErrors(($data->key() + 1) . '行目のカテゴリが、子カテゴリまたは商品が紐付いているため削除できません。');
536
+                                    $this->addErrors(($data->key() + 1).'行目のカテゴリが、子カテゴリまたは商品が紐付いているため削除できません。');
537 537
                                     return $this->render($app, $form, $headers, $this->categoryTwig);
538 538
                                 }
539 539
                             } else {
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
                         }
543 543
 
544 544
                         if (!$status) {
545
-                            $this->addErrors(($data->key() + 1) . '行目のカテゴリが設定できません。');
545
+                            $this->addErrors(($data->key() + 1).'行目のカテゴリが設定できません。');
546 546
                         }
547 547
 
548 548
                         if ($this->hasErrors()) {
@@ -587,7 +587,7 @@  discard block
 block discarded – undo
587 587
             throw new NotFoundHttpException();
588 588
         }
589 589
 
590
-        $response->setCallback(function () use ($app, $request, $headers) {
590
+        $response->setCallback(function() use ($app, $request, $headers) {
591 591
 
592 592
             // ヘッダ行の出力
593 593
             $row = array();
@@ -602,7 +602,7 @@  discard block
 block discarded – undo
602 602
         });
603 603
 
604 604
         $response->headers->set('Content-Type', 'application/octet-stream');
605
-        $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename);
605
+        $response->headers->set('Content-Disposition', 'attachment; filename='.$filename);
606 606
         $response->send();
607 607
 
608 608
         return $response;
@@ -625,7 +625,7 @@  discard block
 block discarded – undo
625 625
         if (!empty($this->fileName)) {
626 626
             try {
627 627
                 $fs = new Filesystem();
628
-                $fs->remove($app['config']['csv_temp_realdir'] . '/' . $this->fileName);
628
+                $fs->remove($app['config']['csv_temp_realdir'].'/'.$this->fileName);
629 629
             } catch (\Exception $e) {
630 630
                 // エラーが発生しても無視する
631 631
             }
@@ -648,10 +648,10 @@  discard block
 block discarded – undo
648 648
     protected function getImportData($app, $formFile)
649 649
     {
650 650
         // アップロードされたCSVファイルを一時ディレクトリに保存
651
-        $this->fileName = 'upload_' . Str::random() . '.' . $formFile->getClientOriginalExtension();
651
+        $this->fileName = 'upload_'.Str::random().'.'.$formFile->getClientOriginalExtension();
652 652
         $formFile->move($app['config']['csv_temp_realdir'], $this->fileName);
653 653
 
654
-        $file = file_get_contents($app['config']['csv_temp_realdir'] . '/' . $this->fileName);
654
+        $file = file_get_contents($app['config']['csv_temp_realdir'].'/'.$this->fileName);
655 655
 
656 656
         if ('\\' === DIRECTORY_SEPARATOR && PHP_VERSION_ID >= 70000) {
657 657
             // Windows 環境の PHP7 の場合はファイルエンコーディングを CP932 に合わせる
@@ -747,8 +747,8 @@  discard block
 block discarded – undo
747 747
                 if (!$Category) {
748 748
                     $this->addErrors(($data->key() + 1).'行目の商品カテゴリ(ID)「'.$category.'」が存在しません。');
749 749
                 } else {
750
-                    foreach($Category->getPath() as $ParentCategory){
751
-                        if (!isset($categoriesIdList[$ParentCategory->getId()])){
750
+                    foreach ($Category->getPath() as $ParentCategory) {
751
+                        if (!isset($categoriesIdList[$ParentCategory->getId()])) {
752 752
                             $ProductCategory = $this->makeProductCategory($Product, $ParentCategory, $rank);
753 753
                             $app['orm.em']->persist($ProductCategory);
754 754
                             $rank++;
@@ -756,7 +756,7 @@  discard block
 block discarded – undo
756 756
                             $categoriesIdList[$ParentCategory->getId()] = true;
757 757
                         }
758 758
                     }
759
-                    if (!isset($categoriesIdList[$Category->getId()])){
759
+                    if (!isset($categoriesIdList[$Category->getId()])) {
760 760
                         $ProductCategory = $this->makeProductCategory($Product, $Category, $rank);
761 761
                         $rank++;
762 762
                         $this->em->persist($ProductCategory);
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
                 }
812 812
             }
813 813
             if (!$Tag) {
814
-                $this->addErrors(($data->key() + 1) . '行目のタグ(ID)「' . $tag_id . '」が存在しません。');
814
+                $this->addErrors(($data->key() + 1).'行目のタグ(ID)「'.$tag_id.'」が存在しません。');
815 815
             }
816 816
         }
817 817
     }
@@ -829,17 +829,17 @@  discard block
 block discarded – undo
829 829
 
830 830
 
831 831
         if ($row['商品種別(ID)'] == '') {
832
-            $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が設定されていません。');
832
+            $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が設定されていません。');
833 833
         } else {
834 834
             if (preg_match('/^\d+$/', $row['商品種別(ID)'])) {
835 835
                 $ProductType = $app['eccube.repository.master.product_type']->find($row['商品種別(ID)']);
836 836
                 if (!$ProductType) {
837
-                    $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。');
837
+                    $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。');
838 838
                 } else {
839 839
                     $ProductClass->setProductType($ProductType);
840 840
                 }
841 841
             } else {
842
-                $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。');
842
+                $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。');
843 843
             }
844 844
         }
845 845
 
@@ -850,12 +850,12 @@  discard block
 block discarded – undo
850 850
             if (preg_match('/^\d+$/', $row['発送日目安(ID)'])) {
851 851
                 $DeliveryDate = $app['eccube.repository.delivery_date']->find($row['発送日目安(ID)']);
852 852
                 if (!$DeliveryDate) {
853
-                    $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。');
853
+                    $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。');
854 854
                 } else {
855 855
                     $ProductClass->setDeliveryDate($DeliveryDate);
856 856
                 }
857 857
             } else {
858
-                $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。');
858
+                $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。');
859 859
             }
860 860
         }
861 861
 
@@ -866,19 +866,19 @@  discard block
 block discarded – undo
866 866
         }
867 867
 
868 868
         if ($row['在庫数無制限フラグ'] == '') {
869
-            $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。');
869
+            $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。');
870 870
         } else {
871 871
             if ($row['在庫数無制限フラグ'] == (string) Constant::DISABLED) {
872 872
                 $ProductClass->setStockUnlimited(Constant::DISABLED);
873 873
                 // 在庫数が設定されていなければエラー
874 874
                 if ($row['在庫数'] == '') {
875
-                    $this->addErrors(($data->key() + 1) . '行目の在庫数が設定されていません。');
875
+                    $this->addErrors(($data->key() + 1).'行目の在庫数が設定されていません。');
876 876
                 } else {
877 877
                     $stock = str_replace(',', '', $row['在庫数']);
878 878
                     if (preg_match('/^\d+$/', $stock) && $stock >= 0) {
879 879
                         $ProductClass->setStock($stock);
880 880
                     } else {
881
-                        $this->addErrors(($data->key() + 1) . '行目の在庫数は0以上の数値を設定してください。');
881
+                        $this->addErrors(($data->key() + 1).'行目の在庫数は0以上の数値を設定してください。');
882 882
                     }
883 883
                 }
884 884
 
@@ -886,7 +886,7 @@  discard block
 block discarded – undo
886 886
                 $ProductClass->setStockUnlimited(Constant::ENABLED);
887 887
                 $ProductClass->setStock(null);
888 888
             } else {
889
-                $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。');
889
+                $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。');
890 890
             }
891 891
         }
892 892
 
@@ -895,7 +895,7 @@  discard block
 block discarded – undo
895 895
             if (preg_match('/^\d+$/', $saleLimit) && $saleLimit >= 0) {
896 896
                 $ProductClass->setSaleLimit($saleLimit);
897 897
             } else {
898
-                $this->addErrors(($data->key() + 1) . '行目の販売制限数は0以上の数値を設定してください。');
898
+                $this->addErrors(($data->key() + 1).'行目の販売制限数は0以上の数値を設定してください。');
899 899
             }
900 900
         }
901 901
 
@@ -904,18 +904,18 @@  discard block
 block discarded – undo
904 904
             if (preg_match('/^\d+$/', $price01) && $price01 >= 0) {
905 905
                 $ProductClass->setPrice01($price01);
906 906
             } else {
907
-                $this->addErrors(($data->key() + 1) . '行目の通常価格は0以上の数値を設定してください。');
907
+                $this->addErrors(($data->key() + 1).'行目の通常価格は0以上の数値を設定してください。');
908 908
             }
909 909
         }
910 910
 
911 911
         if ($row['販売価格'] == '') {
912
-            $this->addErrors(($data->key() + 1) . '行目の販売価格が設定されていません。');
912
+            $this->addErrors(($data->key() + 1).'行目の販売価格が設定されていません。');
913 913
         } else {
914 914
             $price02 = str_replace(',', '', $row['販売価格']);
915 915
             if (preg_match('/^\d+$/', $price02) && $price02 >= 0) {
916 916
                 $ProductClass->setPrice02($price02);
917 917
             } else {
918
-                $this->addErrors(($data->key() + 1) . '行目の販売価格は0以上の数値を設定してください。');
918
+                $this->addErrors(($data->key() + 1).'行目の販売価格は0以上の数値を設定してください。');
919 919
             }
920 920
         }
921 921
 
@@ -924,7 +924,7 @@  discard block
 block discarded – undo
924 924
             if (preg_match('/^\d+$/', $delivery_fee) && $delivery_fee >= 0) {
925 925
                 $ProductClass->setDeliveryFee($delivery_fee);
926 926
             } else {
927
-                $this->addErrors(($data->key() + 1) . '行目の送料は0以上の数値を設定してください。');
927
+                $this->addErrors(($data->key() + 1).'行目の送料は0以上の数値を設定してください。');
928 928
             }
929 929
         }
930 930
 
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
             if ($row['商品規格削除フラグ'] == (string) Constant::DISABLED || $row['商品規格削除フラグ'] == (string) Constant::ENABLED) {
935 935
                 $ProductClass->setDelFlg($row['商品規格削除フラグ']);
936 936
             } else {
937
-                $this->addErrors(($data->key() + 1) . '行目の商品規格削除フラグが設定されていません。');
937
+                $this->addErrors(($data->key() + 1).'行目の商品規格削除フラグが設定されていません。');
938 938
             }
939 939
         }
940 940
 
@@ -967,17 +967,17 @@  discard block
 block discarded – undo
967 967
         $ProductClass->setProduct($Product);
968 968
 
969 969
         if ($row['商品種別(ID)'] == '') {
970
-            $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が設定されていません。');
970
+            $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が設定されていません。');
971 971
         } else {
972 972
             if (preg_match('/^\d+$/', $row['商品種別(ID)'])) {
973 973
                 $ProductType = $app['eccube.repository.master.product_type']->find($row['商品種別(ID)']);
974 974
                 if (!$ProductType) {
975
-                    $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。');
975
+                    $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。');
976 976
                 } else {
977 977
                     $ProductClass->setProductType($ProductType);
978 978
                 }
979 979
             } else {
980
-                $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。');
980
+                $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。');
981 981
             }
982 982
         }
983 983
 
@@ -986,12 +986,12 @@  discard block
 block discarded – undo
986 986
             if (preg_match('/^\d+$/', $row['規格分類1(ID)'])) {
987 987
                 $ClassCategory = $app['eccube.repository.class_category']->find($row['規格分類1(ID)']);
988 988
                 if (!$ClassCategory) {
989
-                    $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。');
989
+                    $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。');
990 990
                 } else {
991 991
                     $ProductClass->setClassCategory1($ClassCategory);
992 992
                 }
993 993
             } else {
994
-                $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。');
994
+                $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。');
995 995
             }
996 996
         }
997 997
 
@@ -999,12 +999,12 @@  discard block
 block discarded – undo
999 999
             if (preg_match('/^\d+$/', $row['規格分類2(ID)'])) {
1000 1000
                 $ClassCategory = $app['eccube.repository.class_category']->find($row['規格分類2(ID)']);
1001 1001
                 if (!$ClassCategory) {
1002
-                    $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。');
1002
+                    $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。');
1003 1003
                 } else {
1004 1004
                     $ProductClass->setClassCategory2($ClassCategory);
1005 1005
                 }
1006 1006
             } else {
1007
-                $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。');
1007
+                $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。');
1008 1008
             }
1009 1009
         }
1010 1010
 
@@ -1012,12 +1012,12 @@  discard block
 block discarded – undo
1012 1012
             if (preg_match('/^\d+$/', $row['発送日目安(ID)'])) {
1013 1013
                 $DeliveryDate = $app['eccube.repository.delivery_date']->find($row['発送日目安(ID)']);
1014 1014
                 if (!$DeliveryDate) {
1015
-                    $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。');
1015
+                    $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。');
1016 1016
                 } else {
1017 1017
                     $ProductClass->setDeliveryDate($DeliveryDate);
1018 1018
                 }
1019 1019
             } else {
1020
-                $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。');
1020
+                $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。');
1021 1021
             }
1022 1022
         }
1023 1023
 
@@ -1028,19 +1028,19 @@  discard block
 block discarded – undo
1028 1028
         }
1029 1029
 
1030 1030
         if ($row['在庫数無制限フラグ'] == '') {
1031
-            $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。');
1031
+            $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。');
1032 1032
         } else {
1033 1033
             if ($row['在庫数無制限フラグ'] == (string) Constant::DISABLED) {
1034 1034
                 $ProductClass->setStockUnlimited(Constant::DISABLED);
1035 1035
                 // 在庫数が設定されていなければエラー
1036 1036
                 if ($row['在庫数'] == '') {
1037
-                    $this->addErrors(($data->key() + 1) . '行目の在庫数が設定されていません。');
1037
+                    $this->addErrors(($data->key() + 1).'行目の在庫数が設定されていません。');
1038 1038
                 } else {
1039 1039
                     $stock = str_replace(',', '', $row['在庫数']);
1040 1040
                     if (preg_match('/^\d+$/', $stock) && $stock >= 0) {
1041 1041
                         $ProductClass->setStock($row['在庫数']);
1042 1042
                     } else {
1043
-                        $this->addErrors(($data->key() + 1) . '行目の在庫数は0以上の数値を設定してください。');
1043
+                        $this->addErrors(($data->key() + 1).'行目の在庫数は0以上の数値を設定してください。');
1044 1044
                     }
1045 1045
                 }
1046 1046
 
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
                 $ProductClass->setStockUnlimited(Constant::ENABLED);
1049 1049
                 $ProductClass->setStock(null);
1050 1050
             } else {
1051
-                $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。');
1051
+                $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。');
1052 1052
             }
1053 1053
         }
1054 1054
 
@@ -1057,7 +1057,7 @@  discard block
 block discarded – undo
1057 1057
             if (preg_match('/^\d+$/', $saleLimit) && $saleLimit >= 0) {
1058 1058
                 $ProductClass->setSaleLimit($saleLimit);
1059 1059
             } else {
1060
-                $this->addErrors(($data->key() + 1) . '行目の販売制限数は0以上の数値を設定してください。');
1060
+                $this->addErrors(($data->key() + 1).'行目の販売制限数は0以上の数値を設定してください。');
1061 1061
             }
1062 1062
         }
1063 1063
 
@@ -1066,18 +1066,18 @@  discard block
 block discarded – undo
1066 1066
             if (preg_match('/^\d+$/', $price01) && $price01 >= 0) {
1067 1067
                 $ProductClass->setPrice01($price01);
1068 1068
             } else {
1069
-                $this->addErrors(($data->key() + 1) . '行目の通常価格は0以上の数値を設定してください。');
1069
+                $this->addErrors(($data->key() + 1).'行目の通常価格は0以上の数値を設定してください。');
1070 1070
             }
1071 1071
         }
1072 1072
 
1073 1073
         if ($row['販売価格'] == '') {
1074
-            $this->addErrors(($data->key() + 1) . '行目の販売価格が設定されていません。');
1074
+            $this->addErrors(($data->key() + 1).'行目の販売価格が設定されていません。');
1075 1075
         } else {
1076 1076
             $price02 = str_replace(',', '', $row['販売価格']);
1077 1077
             if (preg_match('/^\d+$/', $price02) && $price02 >= 0) {
1078 1078
                 $ProductClass->setPrice02($price02);
1079 1079
             } else {
1080
-                $this->addErrors(($data->key() + 1) . '行目の販売価格は0以上の数値を設定してください。');
1080
+                $this->addErrors(($data->key() + 1).'行目の販売価格は0以上の数値を設定してください。');
1081 1081
             }
1082 1082
         }
1083 1083
 
@@ -1087,7 +1087,7 @@  discard block
 block discarded – undo
1087 1087
             if ($row['商品規格削除フラグ'] == (string) Constant::DISABLED || $row['商品規格削除フラグ'] == (string) Constant::ENABLED) {
1088 1088
                 $ProductClass->setDelFlg($row['商品規格削除フラグ']);
1089 1089
             } else {
1090
-                $this->addErrors(($data->key() + 1) . '行目の商品規格削除フラグが設定されていません。');
1090
+                $this->addErrors(($data->key() + 1).'行目の商品規格削除フラグが設定されていません。');
1091 1091
             }
1092 1092
         }
1093 1093
 
Please login to merge, or discard this patch.