Completed
Pull Request — master (#2050)
by
unknown
39:48
created
src/Eccube/Command/PluginCommand/PluginGenerator.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
     {
51 51
         $this->output->writeln('------------------------------------------------------');
52 52
         $this->output->writeln('---Plugin Generator');
53
-        $this->output->writeln('---[*]You can exit from Console Application, by typing ' . self::STOP_PROCESS . ' instead of typing another word.');
53
+        $this->output->writeln('---[*]You can exit from Console Application, by typing '.self::STOP_PROCESS.' instead of typing another word.');
54 54
         $this->output->writeln('------------------------------------------------------');
55 55
         $this->output->writeln('');
56 56
     }
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                 'label' => '[+]Old version support: ',
102 102
                 'value' => null,
103 103
                 'name' => '[+]Do you want to support old versions too? [y/n]',
104
-                'show' => array(1 => 'Yes' ,0 => 'No'),
104
+                'show' => array(1 => 'Yes', 0 => 'No'),
105 105
                 'validation' => array(
106 106
                     'isRequired' => true,
107 107
                     'choice' => array('y' => 1, 'n' => 0)
@@ -148,13 +148,13 @@  discard block
 block discarded – undo
148 148
             $this->events = array();
149 149
             $routeEvents = array();
150 150
             if ($this->paramList['supportFlag']['value']) {
151
-                $this->events = include $this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/eventsList.php';
151
+                $this->events = include $this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/eventsList.php';
152 152
                 $routeEvents['eccube.event.controller.__route__.before'] = 'Controller__route__Before';
153 153
                 $routeEvents['eccube.event.controller.__route__.after'] = 'Controller__route__After';
154 154
                 $routeEvents['eccube.event.controller.__route__.finish'] = 'Controller__route__Finish';
155 155
                 $routeEvents['eccube.event.render.__route__.before'] = 'Render__route__Before';
156 156
             }
157
-            $this->events += include $this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/eventsListNew.php';
157
+            $this->events += include $this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/eventsListNew.php';
158 158
 
159 159
             $routeEvents['eccube.event.route.__route__.request'] = 'Route__route__Request';
160 160
             $routeEvents['eccube.event.route.__route__.controller'] = 'Route__route__Controller';
@@ -214,11 +214,11 @@  discard block
 block discarded – undo
214 214
         $config['code'] = $code;
215 215
         $config['version'] = $paramList['version']['value'];
216 216
         if (!empty($paramList['hookPoints']['value'])) {
217
-            $config['event'] = $code . 'Event';
217
+            $config['event'] = $code.'Event';
218 218
         }
219
-        $config['service'] = array($code . 'ServiceProvider');
219
+        $config['service'] = array($code.'ServiceProvider');
220 220
 
221
-        $codePath = $this->app['config']['root_dir'] . '/app/Plugin/' . $code;
221
+        $codePath = $this->app['config']['root_dir'].'/app/Plugin/'.$code;
222 222
 
223 223
         $file = new Filesystem();
224 224
         $file->mkdir($codePath);
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
             $fsList['dir'][$codePath] = false;
229 229
         }
230 230
 
231
-        $srcPath = $codePath . '/config.yml';
231
+        $srcPath = $codePath.'/config.yml';
232 232
         file_put_contents($srcPath, Yaml::dump($config));
233 233
         if (is_file($srcPath)) {
234 234
             $fsList['file'][$srcPath] = true;
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
         $year = date('Y');
241 241
 
242 242
         // PluginManager
243
-        $pluginFileBefore = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/PluginManager.php');
243
+        $pluginFileBefore = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/PluginManager.php');
244 244
         $from = '/\[code\]/';
245 245
         $pluginFileAfter = preg_replace($from, $code, $pluginFileBefore);
246 246
         $from = '/\[author\]/';
@@ -248,7 +248,7 @@  discard block
 block discarded – undo
248 248
         $from = '/\[year\]/';
249 249
         $pluginFileAfter = preg_replace($from, $year, $pluginFileAfter);
250 250
 
251
-        $srcPath = $codePath . '/PluginManager.php';
251
+        $srcPath = $codePath.'/PluginManager.php';
252 252
         file_put_contents($srcPath, $pluginFileAfter);
253 253
         if (is_file($srcPath)) {
254 254
             $fsList['file'][$srcPath] = true;
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
         }
258 258
 
259 259
         // ServiceProvider
260
-        $pluginFileBefore = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/ServiceProvider.php');
260
+        $pluginFileBefore = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/ServiceProvider.php');
261 261
         $from = '/\[code\]/';
262 262
         $pluginFileAfter = preg_replace($from, $code, $pluginFileBefore);
263 263
         $from = '/\[author\]/';
@@ -265,14 +265,14 @@  discard block
 block discarded – undo
265 265
         $from = '/\[year\]/';
266 266
         $pluginFileAfter = preg_replace($from, $year, $pluginFileAfter);
267 267
 
268
-        $file->mkdir($codePath . '/ServiceProvider');
269
-        if (is_dir($codePath . '/ServiceProvider')) {
270
-            $fsList['dir'][$codePath . '/ServiceProvider'] = true;
268
+        $file->mkdir($codePath.'/ServiceProvider');
269
+        if (is_dir($codePath.'/ServiceProvider')) {
270
+            $fsList['dir'][$codePath.'/ServiceProvider'] = true;
271 271
         } else {
272
-            $fsList['dir'][$codePath . '/ServiceProvider'] = false;
272
+            $fsList['dir'][$codePath.'/ServiceProvider'] = false;
273 273
         }
274 274
 
275
-        $srcPath = $codePath . '/ServiceProvider/' . $code . 'ServiceProvider.php';
275
+        $srcPath = $codePath.'/ServiceProvider/'.$code.'ServiceProvider.php';
276 276
         file_put_contents($srcPath, $pluginFileAfter);
277 277
         if (is_file($srcPath)) {
278 278
             $fsList['file'][$srcPath] = true;
@@ -281,7 +281,7 @@  discard block
 block discarded – undo
281 281
         }
282 282
 
283 283
         // ConfigController
284
-        $pluginFileBefore = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/ConfigController.php');
284
+        $pluginFileBefore = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/ConfigController.php');
285 285
         $from = '/\[code\]/';
286 286
         $pluginFileAfter = preg_replace($from, $code, $pluginFileBefore);
287 287
         $from = '/\[author\]/';
@@ -291,14 +291,14 @@  discard block
 block discarded – undo
291 291
         $from = '/\[code_name\]/';
292 292
         $pluginFileAfter = preg_replace($from, mb_strtolower($code), $pluginFileAfter);
293 293
 
294
-        $file->mkdir($codePath . '/Controller');
295
-        if (is_dir($codePath . '/Controller')) {
296
-            $fsList['dir'][$codePath . '/Controller'] = true;
294
+        $file->mkdir($codePath.'/Controller');
295
+        if (is_dir($codePath.'/Controller')) {
296
+            $fsList['dir'][$codePath.'/Controller'] = true;
297 297
         } else {
298
-            $fsList['dir'][$codePath . '/Controller'] = false;
298
+            $fsList['dir'][$codePath.'/Controller'] = false;
299 299
         }
300 300
 
301
-        $srcPath = $codePath . '/Controller/ConfigController.php';
301
+        $srcPath = $codePath.'/Controller/ConfigController.php';
302 302
         file_put_contents($srcPath, $pluginFileAfter);
303 303
         if (is_file($srcPath)) {
304 304
             $fsList['file'][$srcPath] = true;
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
         }
308 308
 
309 309
         // Controller
310
-        $pluginFileBefore = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/Controller.php');
310
+        $pluginFileBefore = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/Controller.php');
311 311
         $from = '/\[code\]/';
312 312
         $pluginFileAfter = preg_replace($from, $code, $pluginFileBefore);
313 313
         $from = '/\[author\]/';
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
         $from = '/\[code_name\]/';
318 318
         $pluginFileAfter = preg_replace($from, mb_strtolower($code), $pluginFileAfter);
319 319
 
320
-        $srcPath = $codePath . '/Controller/' . $code . 'Controller.php';
320
+        $srcPath = $codePath.'/Controller/'.$code.'Controller.php';
321 321
         file_put_contents($srcPath, $pluginFileAfter);
322 322
         if (is_file($srcPath)) {
323 323
             $fsList['file'][$srcPath] = true;
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
         }
327 327
 
328 328
         // Form
329
-        $pluginFileBefore = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/ConfigType.php');
329
+        $pluginFileBefore = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/ConfigType.php');
330 330
         $from = '/\[code\]/';
331 331
         $pluginFileAfter = preg_replace($from, $code, $pluginFileBefore);
332 332
         $from = '/\[author\]/';
@@ -336,15 +336,15 @@  discard block
 block discarded – undo
336 336
         $from = '/\[code_name\]/';
337 337
         $pluginFileAfter = preg_replace($from, mb_strtolower($code), $pluginFileAfter);
338 338
 
339
-        $file->mkdir($codePath . '/Form/Type');
340
-        if (is_dir($codePath . '/Form/Type')) {
341
-            $fsList['dir'][$codePath . '/Form/Type'] = true;
339
+        $file->mkdir($codePath.'/Form/Type');
340
+        if (is_dir($codePath.'/Form/Type')) {
341
+            $fsList['dir'][$codePath.'/Form/Type'] = true;
342 342
         } else {
343
-            $fsList['dir'][$codePath . '/Form/Type'] = false;
343
+            $fsList['dir'][$codePath.'/Form/Type'] = false;
344 344
         }
345 345
 
346
-        $srcPath = $codePath . '/Form/Type/' . $code . 'ConfigType.php';
347
-        file_put_contents($codePath . '/Form/Type/' . $code . 'ConfigType.php', $pluginFileAfter);
346
+        $srcPath = $codePath.'/Form/Type/'.$code.'ConfigType.php';
347
+        file_put_contents($codePath.'/Form/Type/'.$code.'ConfigType.php', $pluginFileAfter);
348 348
         if (is_file($srcPath)) {
349 349
             $fsList['file'][$srcPath] = true;
350 350
         } else {
@@ -352,18 +352,18 @@  discard block
 block discarded – undo
352 352
         }
353 353
 
354 354
         // Twig
355
-        $pluginFileBefore = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/config.twig');
355
+        $pluginFileBefore = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/config.twig');
356 356
         $from = '/\[code\]/';
357 357
         $pluginFileAfter = preg_replace($from, $code, $pluginFileBefore);
358 358
 
359
-        $file->mkdir($codePath . '/Resource/template/admin');
360
-        if (is_dir($codePath . '/Resource/template/admin')) {
361
-            $fsList['dir'][$codePath . '/Resource/template/admin'] = true;
359
+        $file->mkdir($codePath.'/Resource/template/admin');
360
+        if (is_dir($codePath.'/Resource/template/admin')) {
361
+            $fsList['dir'][$codePath.'/Resource/template/admin'] = true;
362 362
         } else {
363
-            $fsList['dir'][$codePath . '/Resource/template/admin'] = false;
363
+            $fsList['dir'][$codePath.'/Resource/template/admin'] = false;
364 364
         }
365 365
 
366
-        $srcPath = $codePath . '/Resource/template/admin/config.twig';
366
+        $srcPath = $codePath.'/Resource/template/admin/config.twig';
367 367
         file_put_contents($srcPath, $pluginFileAfter);
368 368
         if (is_file($srcPath)) {
369 369
             $fsList['file'][$srcPath] = true;
@@ -372,18 +372,18 @@  discard block
 block discarded – undo
372 372
         }
373 373
 
374 374
         // index.twig
375
-        $pluginFileBefore = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/index.twig');
375
+        $pluginFileBefore = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/index.twig');
376 376
         $from = '/\[code\]/';
377 377
         $pluginFileAfter = preg_replace($from, $code, $pluginFileBefore);
378 378
 
379
-        $file->mkdir($codePath . '/Resource/template/admin');
380
-        if (is_dir($codePath . '/Resource/template/admin')) {
381
-            $fsList['dir'][$codePath . '/Resource/template/admin'] = true;
379
+        $file->mkdir($codePath.'/Resource/template/admin');
380
+        if (is_dir($codePath.'/Resource/template/admin')) {
381
+            $fsList['dir'][$codePath.'/Resource/template/admin'] = true;
382 382
         } else {
383
-            $fsList['dir'][$codePath . '/Resource/template/admin'] = false;
383
+            $fsList['dir'][$codePath.'/Resource/template/admin'] = false;
384 384
         }
385 385
 
386
-        $srcPath = $codePath . '/Resource/template/index.twig';
386
+        $srcPath = $codePath.'/Resource/template/index.twig';
387 387
         file_put_contents($srcPath, $pluginFileAfter);
388 388
         if (is_file($srcPath)) {
389 389
             $fsList['file'][$srcPath] = true;
@@ -398,8 +398,8 @@  discard block
 block discarded – undo
398 398
         $events = $paramList['events']['value'];
399 399
         if (count($events) > 0) {
400 400
             foreach ($events as $eventKey => $eventConst) {
401
-                $onEvents[$eventKey] = array(array('on' . $eventConst . ', NORMAL'));
402
-                $onFunctions[] = 'on' . $eventConst;
401
+                $onEvents[$eventKey] = array(array('on'.$eventConst.', NORMAL'));
402
+                $onFunctions[] = 'on'.$eventConst;
403 403
             }
404 404
         }
405 405
 
@@ -407,14 +407,14 @@  discard block
 block discarded – undo
407 407
         $hookPoints = $paramList['hookPoints']['value'];
408 408
         if (count($hookPoints)) {
409 409
             foreach ($hookPoints as $hookKey => $hookConst) {
410
-                $onName = 'on' . join(array_map('ucfirst', explode('_', strtolower($hookConst))));
411
-                $onEvents[$hookKey] = array(array($onName . ', NORMAL'));
410
+                $onName = 'on'.join(array_map('ucfirst', explode('_', strtolower($hookConst))));
411
+                $onEvents[$hookKey] = array(array($onName.', NORMAL'));
412 412
                 $onFunctions[] = $onName;
413 413
             }
414 414
         }
415 415
 
416 416
         if (count($onEvents)) {
417
-            $srcPath = $codePath . '/event.yml';
417
+            $srcPath = $codePath.'/event.yml';
418 418
             file_put_contents($srcPath, str_replace('\'', '', Yaml::dump($onEvents)));
419 419
             if (is_file($srcPath)) {
420 420
                 $fsList['file'][$srcPath] = true;
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
                 $fsList['file'][$srcPath] = false;
423 423
             }
424 424
 
425
-            $pluginFileBefore = file_get_contents($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/EventHookpoint2.php');
425
+            $pluginFileBefore = file_get_contents($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/EventHookpoint2.php');
426 426
 
427 427
             // Event
428 428
             $from = '/\[code\]/';
@@ -434,11 +434,11 @@  discard block
 block discarded – undo
434 434
 
435 435
             $functions = '';
436 436
             foreach ($onFunctions as $functionName) {
437
-                $functions .= "    public function " . $functionName . "(EventArgs \$event)\n    {\n    }\n\n";
437
+                $functions .= "    public function ".$functionName."(EventArgs \$event)\n    {\n    }\n\n";
438 438
             }
439 439
             $from = '/\[hookpoint_function\]/';
440 440
             $pluginFileAfter = preg_replace($from, $functions, $pluginFileAfter);
441
-            $srcPath = $codePath . '/' . $code . 'Event.php';
441
+            $srcPath = $codePath.'/'.$code.'Event.php';
442 442
             file_put_contents($srcPath, $pluginFileAfter);
443 443
             if (is_file($srcPath)) {
444 444
                 $fsList['file'][$srcPath] = true;
@@ -452,9 +452,9 @@  discard block
 block discarded – undo
452 452
         $config['name'] = $paramList['pluginName']['value'];
453 453
         $config['code'] = $code;
454 454
         $config['version'] = $paramList['version']['value'];
455
-        $config['event'] = $code . 'Event';
456
-        $config['service'] = array($code . 'ServiceProvider');
457
-        $srcPath = $codePath . '/config.yml';
455
+        $config['event'] = $code.'Event';
456
+        $config['service'] = array($code.'ServiceProvider');
457
+        $srcPath = $codePath.'/config.yml';
458 458
         file_put_contents($srcPath, Yaml::dump($config));
459 459
         if (is_file($srcPath)) {
460 460
             $fsList['file'][$srcPath] = true;
@@ -463,8 +463,8 @@  discard block
 block discarded – undo
463 463
         }
464 464
 
465 465
         // LICENSE
466
-        $srcPath = $codePath . '/LICENSE';
467
-        $file->copy($this->app['config']['root_dir'] . '/src/Eccube/Command/PluginCommand/Resource/LICENSE', $srcPath);
466
+        $srcPath = $codePath.'/LICENSE';
467
+        $file->copy($this->app['config']['root_dir'].'/src/Eccube/Command/PluginCommand/Resource/LICENSE', $srcPath);
468 468
         if (is_file($srcPath)) {
469 469
             $fsList['file'][$srcPath] = true;
470 470
         } else {
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
             $this->output->writeln('');
494 494
             $this->output->writeln(' this files and folders were created.');
495 495
             foreach ($dirFileOk as $path) {
496
-                $this->output->writeln('<info> - ' . $path . '</info>');
496
+                $this->output->writeln('<info> - '.$path.'</info>');
497 497
             }
498 498
         }
499 499
 
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
             $this->output->writeln('');
502 502
             $this->output->writeln(' this files and folders was not created.');
503 503
             foreach ($dirFileOk as $path) {
504
-                $this->output->writeln('<error> - ' . $path . '</error>');
504
+                $this->output->writeln('<error> - '.$path.'</error>');
505 505
             }
506 506
         }
507 507
     }
@@ -524,9 +524,9 @@  discard block
 block discarded – undo
524 524
         $this->output->writeln('');
525 525
         $this->output->writeln('[+]Database');
526 526
         if ($Plugin->getId()) {
527
-            $this->output->writeln('<info> Plugin information was added to table [DB.Plugin] (id=' . $Plugin->getId() . ')</info>');
527
+            $this->output->writeln('<info> Plugin information was added to table [DB.Plugin] (id='.$Plugin->getId().')</info>');
528 528
         } else {
529
-            $this->output->writeln('<error> there was a problem inserting plugin information to table [DB.Plugin] (id=' . $Plugin->getId() . ')</error>');
529
+            $this->output->writeln('<error> there was a problem inserting plugin information to table [DB.Plugin] (id='.$Plugin->getId().')</error>');
530 530
         }
531 531
 
532 532
         $hookPoints = $paramList['hookPoints']['value'];
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
         $eventCount = 0;
538 538
         foreach ($hookPoints as $hookKey => $hookConst) {
539 539
             $PluginEventHandler = new PluginEventHandler();
540
-            $functionName = 'on' . join(array_map('ucfirst', explode('_', strtolower($hookConst))));
540
+            $functionName = 'on'.join(array_map('ucfirst', explode('_', strtolower($hookConst))));
541 541
             $PluginEventHandler->setPlugin($Plugin)
542 542
                 ->setEvent($hookKey)
543 543
                 ->setPriority($this->app['eccube.repository.plugin_event_handler']->calcNewPriority($hookKey, $functionName))
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
         $this->app['orm.em']->flush();
551 551
         if ($eventCount) {
552 552
             $this->output->writeln('');
553
-            $this->output->writeln('<info> Plugin information was added to table [DB.PluginEventHandler] (inserts number=' . $eventCount . ') </info>');
553
+            $this->output->writeln('<info> Plugin information was added to table [DB.PluginEventHandler] (inserts number='.$eventCount.') </info>');
554 554
         }
555 555
     }
556 556
 }
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Product/CsvImportController.php 3 patches
Doc Comments   +11 added lines patch added patch discarded remove patch
@@ -590,6 +590,8 @@  discard block
 block discarded – undo
590 590
     /**
591 591
      * 登録、更新時のエラー画面表示
592 592
      *
593
+     * @param Application $app
594
+     * @param string $twig
593 595
      */
594 596
     protected function render($app, $form, $headers, $twig)
595 597
     {
@@ -621,6 +623,7 @@  discard block
 block discarded – undo
621 623
      * アップロードされたCSVファイルの行ごとの処理
622 624
      *
623 625
      * @param $formFile
626
+     * @param Application $app
624 627
      * @return CsvImportService
625 628
      */
626 629
     protected function getImportData($app, $formFile)
@@ -698,6 +701,8 @@  discard block
 block discarded – undo
698 701
 
699 702
     /**
700 703
      * 商品カテゴリの削除、登録
704
+     * @param Application $app
705
+     * @param CsvImportService $data
701 706
      */
702 707
     protected function createProductCategory($row, Product $Product, $app, $data)
703 708
     {
@@ -797,6 +802,8 @@  discard block
 block discarded – undo
797 802
 
798 803
     /**
799 804
      * 商品規格分類1、商品規格分類2がnullとなる商品規格情報を作成
805
+     * @param Application $app
806
+     * @param CsvImportService $data
800 807
      */
801 808
     protected function createProductClass($row, Product $Product, $app, $data, $ClassCategory1 = null, $ClassCategory2 = null)
802 809
     {
@@ -938,6 +945,8 @@  discard block
 block discarded – undo
938 945
 
939 946
     /**
940 947
      * 商品規格情報を更新
948
+     * @param Application $app
949
+     * @param CsvImportService $data
941 950
      */
942 951
     protected function updateProductClass($row, Product $Product, ProductClass $ProductClass, $app, $data)
943 952
     {
@@ -1084,6 +1093,7 @@  discard block
 block discarded – undo
1084 1093
     /**
1085 1094
      * 登録、更新時のエラー画面表示
1086 1095
      *
1096
+     * @param string $message
1087 1097
      */
1088 1098
     protected function addErrors($message)
1089 1099
     {
@@ -1158,6 +1168,7 @@  discard block
 block discarded – undo
1158 1168
      * ProductCategory作成
1159 1169
      * @param \Eccube\Entity\Product $Product
1160 1170
      * @param \Eccube\Entity\Category $Category
1171
+     * @param integer $rank
1161 1172
      * @return ProductCategory
1162 1173
      */
1163 1174
     private function makeProductCategory($Product, $Category, $rank)
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1155,11 +1155,11 @@
 block discarded – undo
1155 1155
     }
1156 1156
     
1157 1157
         /**
1158
-     * ProductCategory作成
1159
-     * @param \Eccube\Entity\Product $Product
1160
-     * @param \Eccube\Entity\Category $Category
1161
-     * @return ProductCategory
1162
-     */
1158
+         * ProductCategory作成
1159
+         * @param \Eccube\Entity\Product $Product
1160
+         * @param \Eccube\Entity\Category $Category
1161
+         * @return ProductCategory
1162
+         */
1163 1163
     private function makeProductCategory($Product, $Category, $rank)
1164 1164
     {
1165 1165
         $ProductCategory = new ProductCategory();
Please login to merge, or discard this patch.
Spacing   +78 added lines, -78 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,14 +513,14 @@  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
 
520 520
                         $status = $app['eccube.repository.category']->save($Category);
521 521
 
522 522
                         if (!$status) {
523
-                            $this->addErrors(($data->key() + 1) . '行目のカテゴリが設定できません。');
523
+                            $this->addErrors(($data->key() + 1).'行目のカテゴリが設定できません。');
524 524
                         }
525 525
 
526 526
                         if ($this->hasErrors()) {
@@ -565,7 +565,7 @@  discard block
 block discarded – undo
565 565
             throw new NotFoundHttpException();
566 566
         }
567 567
 
568
-        $response->setCallback(function () use ($app, $request, $headers) {
568
+        $response->setCallback(function() use ($app, $request, $headers) {
569 569
 
570 570
             // ヘッダ行の出力
571 571
             $row = array();
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
         });
581 581
 
582 582
         $response->headers->set('Content-Type', 'application/octet-stream');
583
-        $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename);
583
+        $response->headers->set('Content-Disposition', 'attachment; filename='.$filename);
584 584
         $response->send();
585 585
 
586 586
         return $response;
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
         if (!empty($this->fileName)) {
604 604
             try {
605 605
                 $fs = new Filesystem();
606
-                $fs->remove($app['config']['csv_temp_realdir'] . '/' . $this->fileName);
606
+                $fs->remove($app['config']['csv_temp_realdir'].'/'.$this->fileName);
607 607
             } catch (\Exception $e) {
608 608
                 // エラーが発生しても無視する
609 609
             }
@@ -626,10 +626,10 @@  discard block
 block discarded – undo
626 626
     protected function getImportData($app, $formFile)
627 627
     {
628 628
         // アップロードされたCSVファイルを一時ディレクトリに保存
629
-        $this->fileName = 'upload_' . Str::random() . '.' . $formFile->getClientOriginalExtension();
629
+        $this->fileName = 'upload_'.Str::random().'.'.$formFile->getClientOriginalExtension();
630 630
         $formFile->move($app['config']['csv_temp_realdir'], $this->fileName);
631 631
 
632
-        $file = file_get_contents($app['config']['csv_temp_realdir'] . '/' . $this->fileName);
632
+        $file = file_get_contents($app['config']['csv_temp_realdir'].'/'.$this->fileName);
633 633
 
634 634
         if ('\\' === DIRECTORY_SEPARATOR && PHP_VERSION_ID >= 70000) {
635 635
             // Windows 環境の PHP7 の場合はファイルエンコーディングを CP932 に合わせる
@@ -725,8 +725,8 @@  discard block
 block discarded – undo
725 725
                 if (!$Category) {
726 726
                     $this->addErrors(($data->key() + 1).'行目の商品カテゴリ(ID)「'.$category.'」が存在しません。');
727 727
                 } else {
728
-                    foreach($Category->getPath() as $ParentCategory){
729
-                        if (!isset($categoriesIdList[$ParentCategory->getId()])){
728
+                    foreach ($Category->getPath() as $ParentCategory) {
729
+                        if (!isset($categoriesIdList[$ParentCategory->getId()])) {
730 730
                             $ProductCategory = $this->makeProductCategory($Product, $ParentCategory, $rank);
731 731
                             $app['orm.em']->persist($ProductCategory);
732 732
                             $rank++;
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
                             $categoriesIdList[$ParentCategory->getId()] = true;
735 735
                         }
736 736
                     }
737
-                    if (!isset($categoriesIdList[$Category->getId()])){
737
+                    if (!isset($categoriesIdList[$Category->getId()])) {
738 738
                         $ProductCategory = $this->makeProductCategory($Product, $Category, $rank);
739 739
                         $rank++;
740 740
                         $this->em->persist($ProductCategory);
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
                 }
790 790
             }
791 791
             if (!$Tag) {
792
-                $this->addErrors(($data->key() + 1) . '行目のタグ(ID)「' . $tag_id . '」が存在しません。');
792
+                $this->addErrors(($data->key() + 1).'行目のタグ(ID)「'.$tag_id.'」が存在しません。');
793 793
             }
794 794
         }
795 795
     }
@@ -807,17 +807,17 @@  discard block
 block discarded – undo
807 807
 
808 808
 
809 809
         if ($row['商品種別(ID)'] == '') {
810
-            $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が設定されていません。');
810
+            $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が設定されていません。');
811 811
         } else {
812 812
             if (preg_match('/^\d+$/', $row['商品種別(ID)'])) {
813 813
                 $ProductType = $app['eccube.repository.master.product_type']->find($row['商品種別(ID)']);
814 814
                 if (!$ProductType) {
815
-                    $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。');
815
+                    $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。');
816 816
                 } else {
817 817
                     $ProductClass->setProductType($ProductType);
818 818
                 }
819 819
             } else {
820
-                $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。');
820
+                $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。');
821 821
             }
822 822
         }
823 823
 
@@ -828,12 +828,12 @@  discard block
 block discarded – undo
828 828
             if (preg_match('/^\d+$/', $row['発送日目安(ID)'])) {
829 829
                 $DeliveryDate = $app['eccube.repository.delivery_date']->find($row['発送日目安(ID)']);
830 830
                 if (!$DeliveryDate) {
831
-                    $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。');
831
+                    $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。');
832 832
                 } else {
833 833
                     $ProductClass->setDeliveryDate($DeliveryDate);
834 834
                 }
835 835
             } else {
836
-                $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。');
836
+                $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。');
837 837
             }
838 838
         }
839 839
 
@@ -844,19 +844,19 @@  discard block
 block discarded – undo
844 844
         }
845 845
 
846 846
         if ($row['在庫数無制限フラグ'] == '') {
847
-            $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。');
847
+            $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。');
848 848
         } else {
849 849
             if ($row['在庫数無制限フラグ'] == (string) Constant::DISABLED) {
850 850
                 $ProductClass->setStockUnlimited(Constant::DISABLED);
851 851
                 // 在庫数が設定されていなければエラー
852 852
                 if ($row['在庫数'] == '') {
853
-                    $this->addErrors(($data->key() + 1) . '行目の在庫数が設定されていません。');
853
+                    $this->addErrors(($data->key() + 1).'行目の在庫数が設定されていません。');
854 854
                 } else {
855 855
                     $stock = str_replace(',', '', $row['在庫数']);
856 856
                     if (preg_match('/^\d+$/', $stock) && $stock >= 0) {
857 857
                         $ProductClass->setStock($stock);
858 858
                     } else {
859
-                        $this->addErrors(($data->key() + 1) . '行目の在庫数は0以上の数値を設定してください。');
859
+                        $this->addErrors(($data->key() + 1).'行目の在庫数は0以上の数値を設定してください。');
860 860
                     }
861 861
                 }
862 862
 
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
                 $ProductClass->setStockUnlimited(Constant::ENABLED);
865 865
                 $ProductClass->setStock(null);
866 866
             } else {
867
-                $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。');
867
+                $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。');
868 868
             }
869 869
         }
870 870
 
@@ -873,7 +873,7 @@  discard block
 block discarded – undo
873 873
             if (preg_match('/^\d+$/', $saleLimit) && $saleLimit >= 0) {
874 874
                 $ProductClass->setSaleLimit($saleLimit);
875 875
             } else {
876
-                $this->addErrors(($data->key() + 1) . '行目の販売制限数は0以上の数値を設定してください。');
876
+                $this->addErrors(($data->key() + 1).'行目の販売制限数は0以上の数値を設定してください。');
877 877
             }
878 878
         }
879 879
 
@@ -882,18 +882,18 @@  discard block
 block discarded – undo
882 882
             if (preg_match('/^\d+$/', $price01) && $price01 >= 0) {
883 883
                 $ProductClass->setPrice01($price01);
884 884
             } else {
885
-                $this->addErrors(($data->key() + 1) . '行目の通常価格は0以上の数値を設定してください。');
885
+                $this->addErrors(($data->key() + 1).'行目の通常価格は0以上の数値を設定してください。');
886 886
             }
887 887
         }
888 888
 
889 889
         if ($row['販売価格'] == '') {
890
-            $this->addErrors(($data->key() + 1) . '行目の販売価格が設定されていません。');
890
+            $this->addErrors(($data->key() + 1).'行目の販売価格が設定されていません。');
891 891
         } else {
892 892
             $price02 = str_replace(',', '', $row['販売価格']);
893 893
             if (preg_match('/^\d+$/', $price02) && $price02 >= 0) {
894 894
                 $ProductClass->setPrice02($price02);
895 895
             } else {
896
-                $this->addErrors(($data->key() + 1) . '行目の販売価格は0以上の数値を設定してください。');
896
+                $this->addErrors(($data->key() + 1).'行目の販売価格は0以上の数値を設定してください。');
897 897
             }
898 898
         }
899 899
 
@@ -902,7 +902,7 @@  discard block
 block discarded – undo
902 902
             if (preg_match('/^\d+$/', $delivery_fee) && $delivery_fee >= 0) {
903 903
                 $ProductClass->setDeliveryFee($delivery_fee);
904 904
             } else {
905
-                $this->addErrors(($data->key() + 1) . '行目の送料は0以上の数値を設定してください。');
905
+                $this->addErrors(($data->key() + 1).'行目の送料は0以上の数値を設定してください。');
906 906
             }
907 907
         }
908 908
 
@@ -912,7 +912,7 @@  discard block
 block discarded – undo
912 912
             if ($row['商品規格削除フラグ'] == (string) Constant::DISABLED || $row['商品規格削除フラグ'] == (string) Constant::ENABLED) {
913 913
                 $ProductClass->setDelFlg($row['商品規格削除フラグ']);
914 914
             } else {
915
-                $this->addErrors(($data->key() + 1) . '行目の商品規格削除フラグが設定されていません。');
915
+                $this->addErrors(($data->key() + 1).'行目の商品規格削除フラグが設定されていません。');
916 916
             }
917 917
         }
918 918
 
@@ -945,17 +945,17 @@  discard block
 block discarded – undo
945 945
         $ProductClass->setProduct($Product);
946 946
 
947 947
         if ($row['商品種別(ID)'] == '') {
948
-            $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が設定されていません。');
948
+            $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が設定されていません。');
949 949
         } else {
950 950
             if (preg_match('/^\d+$/', $row['商品種別(ID)'])) {
951 951
                 $ProductType = $app['eccube.repository.master.product_type']->find($row['商品種別(ID)']);
952 952
                 if (!$ProductType) {
953
-                    $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。');
953
+                    $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。');
954 954
                 } else {
955 955
                     $ProductClass->setProductType($ProductType);
956 956
                 }
957 957
             } else {
958
-                $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。');
958
+                $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。');
959 959
             }
960 960
         }
961 961
 
@@ -964,12 +964,12 @@  discard block
 block discarded – undo
964 964
             if (preg_match('/^\d+$/', $row['規格分類1(ID)'])) {
965 965
                 $ClassCategory = $app['eccube.repository.class_category']->find($row['規格分類1(ID)']);
966 966
                 if (!$ClassCategory) {
967
-                    $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。');
967
+                    $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。');
968 968
                 } else {
969 969
                     $ProductClass->setClassCategory1($ClassCategory);
970 970
                 }
971 971
             } else {
972
-                $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。');
972
+                $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。');
973 973
             }
974 974
         }
975 975
 
@@ -977,12 +977,12 @@  discard block
 block discarded – undo
977 977
             if (preg_match('/^\d+$/', $row['規格分類2(ID)'])) {
978 978
                 $ClassCategory = $app['eccube.repository.class_category']->find($row['規格分類2(ID)']);
979 979
                 if (!$ClassCategory) {
980
-                    $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。');
980
+                    $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。');
981 981
                 } else {
982 982
                     $ProductClass->setClassCategory2($ClassCategory);
983 983
                 }
984 984
             } else {
985
-                $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。');
985
+                $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。');
986 986
             }
987 987
         }
988 988
 
@@ -990,12 +990,12 @@  discard block
 block discarded – undo
990 990
             if (preg_match('/^\d+$/', $row['発送日目安(ID)'])) {
991 991
                 $DeliveryDate = $app['eccube.repository.delivery_date']->find($row['発送日目安(ID)']);
992 992
                 if (!$DeliveryDate) {
993
-                    $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。');
993
+                    $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。');
994 994
                 } else {
995 995
                     $ProductClass->setDeliveryDate($DeliveryDate);
996 996
                 }
997 997
             } else {
998
-                $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。');
998
+                $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。');
999 999
             }
1000 1000
         }
1001 1001
 
@@ -1006,19 +1006,19 @@  discard block
 block discarded – undo
1006 1006
         }
1007 1007
 
1008 1008
         if ($row['在庫数無制限フラグ'] == '') {
1009
-            $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。');
1009
+            $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。');
1010 1010
         } else {
1011 1011
             if ($row['在庫数無制限フラグ'] == (string) Constant::DISABLED) {
1012 1012
                 $ProductClass->setStockUnlimited(Constant::DISABLED);
1013 1013
                 // 在庫数が設定されていなければエラー
1014 1014
                 if ($row['在庫数'] == '') {
1015
-                    $this->addErrors(($data->key() + 1) . '行目の在庫数が設定されていません。');
1015
+                    $this->addErrors(($data->key() + 1).'行目の在庫数が設定されていません。');
1016 1016
                 } else {
1017 1017
                     $stock = str_replace(',', '', $row['在庫数']);
1018 1018
                     if (preg_match('/^\d+$/', $stock) && $stock >= 0) {
1019 1019
                         $ProductClass->setStock($row['在庫数']);
1020 1020
                     } else {
1021
-                        $this->addErrors(($data->key() + 1) . '行目の在庫数は0以上の数値を設定してください。');
1021
+                        $this->addErrors(($data->key() + 1).'行目の在庫数は0以上の数値を設定してください。');
1022 1022
                     }
1023 1023
                 }
1024 1024
 
@@ -1026,7 +1026,7 @@  discard block
 block discarded – undo
1026 1026
                 $ProductClass->setStockUnlimited(Constant::ENABLED);
1027 1027
                 $ProductClass->setStock(null);
1028 1028
             } else {
1029
-                $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。');
1029
+                $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。');
1030 1030
             }
1031 1031
         }
1032 1032
 
@@ -1035,7 +1035,7 @@  discard block
 block discarded – undo
1035 1035
             if (preg_match('/^\d+$/', $saleLimit) && $saleLimit >= 0) {
1036 1036
                 $ProductClass->setSaleLimit($saleLimit);
1037 1037
             } else {
1038
-                $this->addErrors(($data->key() + 1) . '行目の販売制限数は0以上の数値を設定してください。');
1038
+                $this->addErrors(($data->key() + 1).'行目の販売制限数は0以上の数値を設定してください。');
1039 1039
             }
1040 1040
         }
1041 1041
 
@@ -1044,18 +1044,18 @@  discard block
 block discarded – undo
1044 1044
             if (preg_match('/^\d+$/', $price01) && $price01 >= 0) {
1045 1045
                 $ProductClass->setPrice01($price01);
1046 1046
             } else {
1047
-                $this->addErrors(($data->key() + 1) . '行目の通常価格は0以上の数値を設定してください。');
1047
+                $this->addErrors(($data->key() + 1).'行目の通常価格は0以上の数値を設定してください。');
1048 1048
             }
1049 1049
         }
1050 1050
 
1051 1051
         if ($row['販売価格'] == '') {
1052
-            $this->addErrors(($data->key() + 1) . '行目の販売価格が設定されていません。');
1052
+            $this->addErrors(($data->key() + 1).'行目の販売価格が設定されていません。');
1053 1053
         } else {
1054 1054
             $price02 = str_replace(',', '', $row['販売価格']);
1055 1055
             if (preg_match('/^\d+$/', $price02) && $price02 >= 0) {
1056 1056
                 $ProductClass->setPrice02($price02);
1057 1057
             } else {
1058
-                $this->addErrors(($data->key() + 1) . '行目の販売価格は0以上の数値を設定してください。');
1058
+                $this->addErrors(($data->key() + 1).'行目の販売価格は0以上の数値を設定してください。');
1059 1059
             }
1060 1060
         }
1061 1061
 
@@ -1065,7 +1065,7 @@  discard block
 block discarded – undo
1065 1065
             if ($row['商品規格削除フラグ'] == (string) Constant::DISABLED || $row['商品規格削除フラグ'] == (string) Constant::ENABLED) {
1066 1066
                 $ProductClass->setDelFlg($row['商品規格削除フラグ']);
1067 1067
             } else {
1068
-                $this->addErrors(($data->key() + 1) . '行目の商品規格削除フラグが設定されていません。');
1068
+                $this->addErrors(($data->key() + 1).'行目の商品規格削除フラグが設定されていません。');
1069 1069
             }
1070 1070
         }
1071 1071
 
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Product/ProductController.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -792,6 +792,7 @@
 block discarded – undo
792 792
      * ProductCategory作成
793 793
      * @param \Eccube\Entity\Product $Product
794 794
      * @param \Eccube\Entity\Category $Category
795
+     * @param integer $count
795 796
      * @return \Eccube\Entity\ProductCategory
796 797
      */
797 798
     private function createProductCategory($Product, $Category, $count)
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
                     }
203 203
 
204 204
                     $extension = $image->getClientOriginalExtension();
205
-                    $filename = date('mdHis') . uniqid('_') . '.' . $extension;
205
+                    $filename = date('mdHis').uniqid('_').'.'.$extension;
206 206
                     $image->move($app['config']['image_temp_realdir'], $filename);
207 207
                     $files[] = $filename;
208 208
                 }
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
         $form = $builder->getForm();
279 279
 
280 280
         if (!$has_class) {
281
-            $ProductClass->setStockUnlimited((boolean)$ProductClass->getStockUnlimited());
281
+            $ProductClass->setStockUnlimited((boolean) $ProductClass->getStockUnlimited());
282 282
             $form['class']->setData($ProductClass);
283 283
         }
284 284
 
@@ -364,8 +364,8 @@  discard block
 block discarded – undo
364 364
                 $Categories = $form->get('Category')->getData();
365 365
                 $categoriesIdList = array();
366 366
                 foreach ($Categories as $Category) {
367
-                    foreach($Category->getPath() as $ParentCategory){
368
-                        if (!isset($categoriesIdList[$ParentCategory->getId()])){
367
+                    foreach ($Category->getPath() as $ParentCategory) {
368
+                        if (!isset($categoriesIdList[$ParentCategory->getId()])) {
369 369
                             $ProductCategory = $this->createProductCategory($Product, $ParentCategory, $count);
370 370
                             $app['orm.em']->persist($ProductCategory);
371 371
                             $count++;
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
                             $categoriesIdList[$ParentCategory->getId()] = true;
375 375
                         }
376 376
                     }
377
-                    if (!isset($categoriesIdList[$Category->getId()])){
377
+                    if (!isset($categoriesIdList[$Category->getId()])) {
378 378
                         $ProductCategory = $this->createProductCategory($Product, $Category, $count);
379 379
                         $app['orm.em']->persist($ProductCategory);
380 380
                         $count++;
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
                     $app['orm.em']->persist($ProductImage);
397 397
 
398 398
                     // 移動
399
-                    $file = new File($app['config']['image_temp_realdir'] . '/' . $add_image);
399
+                    $file = new File($app['config']['image_temp_realdir'].'/'.$add_image);
400 400
                     $file->move($app['config']['image_save_realdir']);
401 401
                 }
402 402
 
@@ -416,7 +416,7 @@  discard block
 block discarded – undo
416 416
 
417 417
                     // 削除
418 418
                     $fs = new Filesystem();
419
-                    $fs->remove($app['config']['image_save_realdir'] . '/' . $delete_image);
419
+                    $fs->remove($app['config']['image_save_realdir'].'/'.$delete_image);
420 420
                 }
421 421
                 $app['orm.em']->persist($Product);
422 422
                 $app['orm.em']->flush();
@@ -574,7 +574,7 @@  discard block
 block discarded – undo
574 574
                 foreach ($deleteImages as $deleteImage) {
575 575
                     try {
576 576
                         $fs = new Filesystem();
577
-                        $fs->remove($app['config']['image_save_realdir'] . '/' . $deleteImage);
577
+                        $fs->remove($app['config']['image_save_realdir'].'/'.$deleteImage);
578 578
                     } catch (\Exception $e) {
579 579
                         // エラーが発生しても無視する
580 580
                     }
@@ -644,10 +644,10 @@  discard block
 block discarded – undo
644 644
 
645 645
                     // 画像ファイルを新規作成
646 646
                     $extension = pathinfo($Image->getFileName(), PATHINFO_EXTENSION);
647
-                    $filename = date('mdHis') . uniqid('_') . '.' . $extension;
647
+                    $filename = date('mdHis').uniqid('_').'.'.$extension;
648 648
                     try {
649 649
                         $fs = new Filesystem();
650
-                        $fs->copy($app['config']['image_save_realdir'] . '/' . $Image->getFileName(), $app['config']['image_save_realdir'] . '/' . $filename);
650
+                        $fs->copy($app['config']['image_save_realdir'].'/'.$Image->getFileName(), $app['config']['image_save_realdir'].'/'.$filename);
651 651
                     } catch (\Exception $e) {
652 652
                         // エラーが発生しても無視する
653 653
                     }
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
         $em->getConfiguration()->setSQLLogger(null);
723 723
 
724 724
         $response = new StreamedResponse();
725
-        $response->setCallback(function () use ($app, $request) {
725
+        $response->setCallback(function() use ($app, $request) {
726 726
 
727 727
             // CSV種別を元に初期化.
728 728
             $app['eccube.service.csv.export']->initCsvType(CsvType::CSV_TYPE_PRODUCT);
@@ -746,7 +746,7 @@  discard block
 block discarded – undo
746 746
 
747 747
             // データ行の出力.
748 748
             $app['eccube.service.csv.export']->setExportQueryBuilder($qb);
749
-            $app['eccube.service.csv.export']->exportData(function ($entity, $csvService) {
749
+            $app['eccube.service.csv.export']->exportData(function($entity, $csvService) {
750 750
 
751 751
                 $Csvs = $csvService->getCsvs();
752 752
 
@@ -778,9 +778,9 @@  discard block
 block discarded – undo
778 778
         });
779 779
 
780 780
         $now = new \DateTime();
781
-        $filename = 'product_' . $now->format('YmdHis') . '.csv';
781
+        $filename = 'product_'.$now->format('YmdHis').'.csv';
782 782
         $response->headers->set('Content-Type', 'application/octet-stream');
783
-        $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename);
783
+        $response->headers->set('Content-Disposition', 'attachment; filename='.$filename);
784 784
         $response->send();
785 785
 
786 786
         log_info('商品CSV出力ファイル名', array($filename));
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Store/PluginController.php 1 patch
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,6 @@
 block discarded – undo
29 29
 use Symfony\Component\EventDispatcher\EventSubscriberInterface;
30 30
 use Symfony\Component\Finder\Finder;
31 31
 use Symfony\Component\Yaml\Yaml;
32
-use Monolog\Logger;
33 32
 
34 33
 class FormEventSubscriber implements EventSubscriberInterface
35 34
 {
Please login to merge, or discard this patch.
src/Eccube/InstallApplication.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
 
40 40
         if (is_writable($logDir)) {
41 41
             if (file_exists($installLog) && !is_writable($installLog)) {
42
-                die($installLog . ' の書込権限を変更して下さい。');
42
+                die($installLog.' の書込権限を変更して下さい。');
43 43
             }
44 44
             // install step2 でログディレクトリに書き込み権限が付与されればログ出力を開始する.
45 45
             $app->register(new \Silex\Provider\MonologServiceProvider(), array(
Please login to merge, or discard this patch.
src/Eccube/ServiceProvider/DebugServiceProvider.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 {
68 68
     public function register(Application $app)
69 69
     {
70
-        $app['var_dumper.cloner'] = $app->share(function ($app) {
70
+        $app['var_dumper.cloner'] = $app->share(function($app) {
71 71
             $cloner = new VarCloner();
72 72
 
73 73
             if (isset($app['debug.max_items'])) {
@@ -81,23 +81,23 @@  discard block
 block discarded – undo
81 81
             return $cloner;
82 82
         });
83 83
 
84
-        $app['data_collector.templates'] = $app->share($app->extend('data_collector.templates', function ($templates) {
84
+        $app['data_collector.templates'] = $app->share($app->extend('data_collector.templates', function($templates) {
85 85
             return array_merge($templates, array(array('dump', '@Debug/Profiler/dump.html.twig')));
86 86
         }));
87 87
 
88
-        $app['data_collector.dump'] = $app->share(function ($app) {
88
+        $app['data_collector.dump'] = $app->share(function($app) {
89 89
             return new DumpDataCollector($app['stopwatch'], $app['code.file_link_format'], null, null, new HtmlDumper());
90 90
         });
91 91
 
92
-        $app['data_collectors'] = $app->share($app->extend('data_collectors', function ($collectors, $app) {
93
-            $collectors['dump'] = $app->share(function ($app) {
92
+        $app['data_collectors'] = $app->share($app->extend('data_collectors', function($collectors, $app) {
93
+            $collectors['dump'] = $app->share(function($app) {
94 94
                 return $app['data_collector.dump'];
95 95
             });
96 96
 
97 97
             return $collectors;
98 98
         }));
99 99
 
100
-        $app['twig'] = $app->share($app->extend('twig', function ($twig, $app) {
100
+        $app['twig'] = $app->share($app->extend('twig', function($twig, $app) {
101 101
             if (class_exists('\Symfony\Bridge\Twig\Extension\DumpExtension')) {
102 102
                 $twig->addExtension(new DumpExtension($app['var_dumper.cloner']));
103 103
             }
@@ -105,13 +105,13 @@  discard block
 block discarded – undo
105 105
             return $twig;
106 106
         }));
107 107
 
108
-        $app['twig.loader.filesystem'] = $app->share($app->extend('twig.loader.filesystem', function ($loader, $app) {
108
+        $app['twig.loader.filesystem'] = $app->share($app->extend('twig.loader.filesystem', function($loader, $app) {
109 109
             $loader->addPath($app['debug.templates_path'], 'Debug');
110 110
 
111 111
             return $loader;
112 112
         }));
113 113
 
114
-        $app['debug.templates_path'] = function () {
114
+        $app['debug.templates_path'] = function() {
115 115
             $r = new \ReflectionClass('Symfony\Bundle\DebugBundle\DependencyInjection\Configuration');
116 116
 
117 117
             return dirname(dirname($r->getFileName())).'/Resources/views';
@@ -123,11 +123,11 @@  discard block
 block discarded – undo
123 123
         // This code is here to lazy load the dump stack. This default
124 124
         // configuration for CLI mode is overridden in HTTP mode on
125 125
         // 'kernel.request' event
126
-        VarDumper::setHandler(function ($var) use ($app) {
126
+        VarDumper::setHandler(function($var) use ($app) {
127 127
             $dumper = $app['data_collector.dump'];
128 128
             $cloner = $app['var_dumper.cloner'];
129 129
 
130
-            $handler = function ($var) use ($dumper, $cloner) {
130
+            $handler = function($var) use ($dumper, $cloner) {
131 131
                 $dumper->dump($cloner->cloneVar($var));
132 132
             };
133 133
 
Please login to merge, or discard this patch.
src/Eccube/Repository/OrderRepository.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -100,14 +100,14 @@  discard block
 block discarded – undo
100 100
         if (isset($searchData['name']) && Str::isNotBlank($searchData['name'])) {
101 101
             $qb
102 102
                 ->andWhere('CONCAT(o.name01, o.name02) LIKE :name')
103
-                ->setParameter('name', '%' . $searchData['name'] . '%');
103
+                ->setParameter('name', '%'.$searchData['name'].'%');
104 104
         }
105 105
 
106 106
         // kana
107 107
         if (isset($searchData['kana']) && Str::isNotBlank($searchData['kana'])) {
108 108
             $qb
109 109
                 ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana')
110
-                ->setParameter('kana', '%' . $searchData['kana'] . '%');
110
+                ->setParameter('kana', '%'.$searchData['kana'].'%');
111 111
         }
112 112
 
113 113
         // email
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
             $qb
245 245
                 ->leftJoin('o.OrderDetails', 'od')
246 246
                 ->andWhere('od.product_name LIKE :buy_product_name')
247
-                ->setParameter('buy_product_name', '%' . $searchData['buy_product_name'] . '%');
247
+                ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%');
248 248
         }
249 249
 
250 250
         // Order By
@@ -274,9 +274,9 @@  discard block
 block discarded – undo
274 274
             $multi = preg_match('/^\d+$/', $searchData['multi']) ? $searchData['multi'] : null;
275 275
             if ($multi === null) {
276 276
                 $qb
277
-                    ->andWhere('o.name01 LIKE :likemulti OR o.name02 LIKE :likemulti OR ' .
277
+                    ->andWhere('o.name01 LIKE :likemulti OR o.name02 LIKE :likemulti OR '.
278 278
                         'o.kana01 LIKE :likemulti OR o.kana02 LIKE :likemulti OR o.company_name LIKE :likemulti')
279
-                    ->setParameter('likemulti', '%' . $searchData['multi'] . '%');
279
+                    ->setParameter('likemulti', '%'.$searchData['multi'].'%');
280 280
             } else {
281 281
                 $qb
282 282
                     ->andWhere('o.id = :multi')
@@ -318,28 +318,28 @@  discard block
 block discarded – undo
318 318
         if (isset($searchData['name']) && Str::isNotBlank($searchData['name'])) {
319 319
             $qb
320 320
                 ->andWhere('CONCAT(o.name01, o.name02) LIKE :name')
321
-                ->setParameter('name', '%' . $searchData['name'] . '%');
321
+                ->setParameter('name', '%'.$searchData['name'].'%');
322 322
         }
323 323
 
324 324
         // kana
325 325
         if (isset($searchData['kana']) && Str::isNotBlank($searchData['kana'])) {
326 326
             $qb
327 327
                 ->andWhere('CONCAT(o.kana01, o.kana02) LIKE :kana')
328
-                ->setParameter('kana', '%' . $searchData['kana'] . '%');
328
+                ->setParameter('kana', '%'.$searchData['kana'].'%');
329 329
         }
330 330
 
331 331
         // email
332 332
         if (isset($searchData['email']) && Str::isNotBlank($searchData['email'])) {
333 333
             $qb
334 334
                 ->andWhere('o.email like :email')
335
-                ->setParameter('email', '%' . $searchData['email'] . '%');
335
+                ->setParameter('email', '%'.$searchData['email'].'%');
336 336
         }
337 337
 
338 338
         // tel
339 339
         if (isset($searchData['tel']) && Str::isNotBlank($searchData['tel'])) {
340 340
             $qb
341 341
                 ->andWhere('CONCAT(o.tel01, o.tel02, o.tel03) LIKE :tel')
342
-                ->setParameter('tel', '%' . $searchData['tel'] . '%');
342
+                ->setParameter('tel', '%'.$searchData['tel'].'%');
343 343
         }
344 344
 
345 345
         // sex
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
             $qb
452 452
                 ->leftJoin('o.OrderDetails', 'od')
453 453
                 ->andWhere('od.product_name LIKE :buy_product_name')
454
-                ->setParameter('buy_product_name', '%' . $searchData['buy_product_name'] . '%');
454
+                ->setParameter('buy_product_name', '%'.$searchData['buy_product_name'].'%');
455 455
         }
456 456
 
457 457
         // Order By
Please login to merge, or discard this patch.
src/Eccube/Repository/ProductRepository.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
                 $key = sprintf('keyword%s', $index);
114 114
                 $qb
115 115
                     ->andWhere(sprintf('NORMALIZE(p.name) LIKE NORMALIZE(:%s) OR NORMALIZE(p.search_word) LIKE NORMALIZE(:%s)', $key, $key))
116
-                    ->setParameter($key, '%' . $keyword . '%');
116
+                    ->setParameter($key, '%'.$keyword.'%');
117 117
             }
118 118
         }
119 119
 
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
             $id = preg_match('/^\d+$/', $searchData['id']) ? $searchData['id'] : null;
176 176
             if ($id === null) {
177 177
             $qb->andWhere('p.name LIKE :likeid OR pc.code LIKE :likeid')
178
-                    ->setParameter('likeid', '%' . $searchData['id'] . '%');
178
+                    ->setParameter('likeid', '%'.$searchData['id'].'%');
179 179
             } else {
180 180
                 $qb->andWhere('p.id = :id')
181 181
                     ->setParameter('id', $id);
Please login to merge, or discard this patch.