Completed
Pull Request — 3.0.9-dev (#1486)
by chihiro
205:27 queued 169:12
created
src/Eccube/Command/CacheClearCommand.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,6 @@
 block discarded – undo
24 24
 
25 25
 namespace Eccube\Command;
26 26
 
27
-use Symfony\Component\Console\Input\InputArgument;
28 27
 use Symfony\Component\Console\Input\InputInterface;
29 28
 use Symfony\Component\Console\Output\OutputInterface;
30 29
 use Symfony\Component\Console\Input\InputOption;
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 
56 56
     protected function execute(InputInterface $input, OutputInterface $output) {
57 57
 
58
-        \Eccube\Util\Cache::clear($this->app,$input->getOption('all'));
58
+        \Eccube\Util\Cache::clear($this->app, $input->getOption('all'));
59 59
         $output->writeln(sprintf("%s <info>success</info>", 'cache:clear'));
60 60
 
61 61
     }
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Content/FileController.php 2 patches
Doc Comments   +11 added lines patch added patch discarded remove patch
@@ -230,6 +230,10 @@  discard block
 block discarded – undo
230 230
         return $str;
231 231
     }
232 232
 
233
+    /**
234
+     * @param string $topDir
235
+     * @param Request $request
236
+     */
233 237
     private function getTree($topDir, $request)
234 238
     {
235 239
         $finder = Finder::create()->in($topDir)
@@ -267,6 +271,10 @@  discard block
 block discarded – undo
267 271
         return $tree;
268 272
     }
269 273
 
274
+    /**
275
+     * @param Application $app
276
+     * @param string $nowDir
277
+     */
270 278
     private function getFileList($app, $nowDir)
271 279
     {
272 280
         $topDir = $app['config']['user_data_realdir'];
@@ -326,6 +334,9 @@  discard block
 block discarded – undo
326 334
         return (strpos($targetDir, $topDir) === 0);
327 335
     }
328 336
 
337
+    /**
338
+     * @return string
339
+     */
329 340
     private function convertStrFromServer($target)
330 341
     {
331 342
         if ($this->encode == self::SJIS) {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     private $error = null;
40 40
     private $encode = '';
41 41
 
42
-    public function __construct(){
42
+    public function __construct() {
43 43
         $this->encode = self::UTF;
44 44
         if ('\\' === DIRECTORY_SEPARATOR) {
45 45
             $this->encode = self::SJIS;
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
         $arrFileList = $this->getFileList($app, $nowDir);
83 83
 
84 84
         $javascript = $this->getJsArrayList($tree);
85
-        $onload = "eccube.fileManager.viewFileTree('tree', arrTree, '" . $nowDir . "', 'tree_select_file', 'tree_status', 'move');";
85
+        $onload = "eccube.fileManager.viewFileTree('tree', arrTree, '".$nowDir."', 'tree_select_file', 'tree_status', 'move');";
86 86
 
87 87
         return $app->render('Content/file.twig', array(
88 88
             'form' => $form->createView(),
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
                 $nowDir = $this->checkDir($request->get('now_dir'), $topDir)
140 140
                     ? $this->normalizePath($request->get('now_dir'))
141 141
                     : $topDir;
142
-                $fs->mkdir($nowDir . '/' . $filename);
142
+                $fs->mkdir($nowDir.'/'.$filename);
143 143
             }
144 144
         }
145 145
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
     {
220 220
         $str = "arrTree = new Array();\n";
221 221
         foreach ($tree as $key => $val) {
222
-            $str .= 'arrTree[' . $key . "] = new Array(" . $key . ", '" . $val['type'] . "', '" . $val['path'] . "', " . $val['rank'] . ',';
222
+            $str .= 'arrTree['.$key."] = new Array(".$key.", '".$val['type']."', '".$val['path']."', ".$val['rank'].',';
223 223
             if ($val['open']) {
224 224
                 $str .= "true);\n";
225 225
             } else {
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
     private function getFileList($app, $nowDir)
271 271
     {
272 272
         $topDir = $app['config']['user_data_realdir'];
273
-        $filter = function (\SplFileInfo $file) use ($topDir) {
273
+        $filter = function(\SplFileInfo $file) use ($topDir) {
274 274
             $acceptPath = realpath($topDir);
275 275
             $targetPath = $file->getRealPath();
276 276
             return (strpos($targetPath, $acceptPath) === 0);
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Order/EditController.php 1 patch
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -377,7 +377,7 @@  discard block
 block discarded – undo
377 377
     /**
378 378
      * フォームからの入直内容に基づいて、受注情報の再計算を行う
379 379
      *
380
-     * @param $app
380
+     * @param Application $app
381 381
      * @param $Order
382 382
      */
383 383
     protected function calculate($app, \Eccube\Entity\Order $Order)
@@ -471,7 +471,7 @@  discard block
 block discarded – undo
471 471
      * - 受注ステータスが入金済に設定された場合に入金日を更新
472 472
      *
473 473
      *
474
-     * @param $app
474
+     * @param Application $app
475 475
      * @param $TargetOrder
476 476
      * @param $OriginOrder
477 477
      */
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Order/MailController.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -259,6 +259,9 @@
 block discarded – undo
259 259
     }
260 260
 
261 261
 
262
+    /**
263
+     * @param Application $app
264
+     */
262 265
     private function createBody($app, $header, $footer, $Order)
263 266
     {
264 267
         return $app->renderView('Mail/order.twig', array(
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -247,7 +247,7 @@
 block discarded – undo
247 247
             }
248 248
         } else {
249 249
             foreach ($_GET as $key => $value) {
250
-                $ids = str_replace('ids', '', $key) . ',' . $ids;
250
+                $ids = str_replace('ids', '', $key).','.$ids;
251 251
             }
252 252
             $ids = substr($ids, 0, -1);
253 253
         }
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Product/CsvImportController.php 2 patches
Doc Comments   +10 added lines patch added patch discarded remove patch
@@ -583,6 +583,8 @@  discard block
 block discarded – undo
583 583
     /**
584 584
      * 登録、更新時のエラー画面表示
585 585
      *
586
+     * @param Application $app
587
+     * @param string $twig
586 588
      */
587 589
     protected function render($app, $form, $headers, $twig)
588 590
     {
@@ -615,6 +617,7 @@  discard block
 block discarded – undo
615 617
      * アップロードされたCSVファイルの行ごとの処理
616 618
      *
617 619
      * @param $formFile
620
+     * @param Application $app
618 621
      * @return CsvImportService
619 622
      */
620 623
     protected function getImportData($app, $formFile)
@@ -682,6 +685,8 @@  discard block
 block discarded – undo
682 685
 
683 686
     /**
684 687
      * 商品カテゴリの削除、登録
688
+     * @param Application $app
689
+     * @param CsvImportService $data
685 690
      */
686 691
     protected function createProductCategory($row, Product $Product, $app, $data)
687 692
     {
@@ -725,6 +730,8 @@  discard block
 block discarded – undo
725 730
 
726 731
     /**
727 732
      * 商品規格分類1、商品規格分類2がnullとなる商品規格情報を作成
733
+     * @param Application $app
734
+     * @param CsvImportService $data
728 735
      */
729 736
     protected function createProductClass($row, Product $Product, $app, $data, $ClassCategory1 = null, $ClassCategory2 = null)
730 737
     {
@@ -866,6 +873,8 @@  discard block
 block discarded – undo
866 873
 
867 874
     /**
868 875
      * 商品規格情報を更新
876
+     * @param Application $app
877
+     * @param CsvImportService $data
869 878
      */
870 879
     protected function updateProductClass($row, Product $Product, ProductClass $ProductClass, $app, $data)
871 880
     {
@@ -1012,6 +1021,7 @@  discard block
 block discarded – undo
1012 1021
     /**
1013 1022
      * 登録、更新時のエラー画面表示
1014 1023
      *
1024
+     * @param string $message
1015 1025
      */
1016 1026
     protected function addErrors($message)
1017 1027
     {
Please login to merge, or discard this patch.
Spacing   +76 added lines, -76 removed lines patch added patch discarded remove patch
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
                     foreach ($data as $row) {
107 107
 
108 108
                         if ($headerSize != count($row)) {
109
-                            $this->addErrors(($data->key() + 1) . '行目のCSVフォーマットが一致しません。');
109
+                            $this->addErrors(($data->key() + 1).'行目のCSVフォーマットが一致しません。');
110 110
                             return $this->render($app, $form, $headers, $this->productTwig);
111 111
                         }
112 112
 
@@ -117,33 +117,33 @@  discard block
 block discarded – undo
117 117
                             if (is_numeric($row['商品ID'])) {
118 118
                                 $Product = $app['eccube.repository.product']->find($row['商品ID']);
119 119
                                 if (!$Product) {
120
-                                    $this->addErrors(($data->key() + 1) . '行目の商品IDが存在しません。');
120
+                                    $this->addErrors(($data->key() + 1).'行目の商品IDが存在しません。');
121 121
                                     return $this->render($app, $form, $headers, $this->productTwig);
122 122
                                 }
123 123
                             } else {
124
-                                $this->addErrors(($data->key() + 1) . '行目の商品IDが存在しません。');
124
+                                $this->addErrors(($data->key() + 1).'行目の商品IDが存在しません。');
125 125
                                 return $this->render($app, $form, $headers, $this->productTwig);
126 126
                             }
127 127
 
128 128
                         }
129 129
 
130 130
                         if ($row['公開ステータス(ID)'] == '') {
131
-                            $this->addErrors(($data->key() + 1) . '行目の公開ステータス(ID)が設定されていません。');
131
+                            $this->addErrors(($data->key() + 1).'行目の公開ステータス(ID)が設定されていません。');
132 132
                         } else {
133 133
                             if (is_numeric($row['公開ステータス(ID)'])) {
134 134
                                 $Disp = $app['eccube.repository.master.disp']->find($row['公開ステータス(ID)']);
135 135
                                 if (!$Disp) {
136
-                                    $this->addErrors(($data->key() + 1) . '行目の公開ステータス(ID)が存在しません。');
136
+                                    $this->addErrors(($data->key() + 1).'行目の公開ステータス(ID)が存在しません。');
137 137
                                 } else {
138 138
                                     $Product->setStatus($Disp);
139 139
                                 }
140 140
                             } else {
141
-                                $this->addErrors(($data->key() + 1) . '行目の公開ステータス(ID)が存在しません。');
141
+                                $this->addErrors(($data->key() + 1).'行目の公開ステータス(ID)が存在しません。');
142 142
                             }
143 143
                         }
144 144
 
145 145
                         if (Str::isBlank($row['商品名'])) {
146
-                            $this->addErrors(($data->key() + 1) . '行目の商品名が設定されていません。');
146
+                            $this->addErrors(($data->key() + 1).'行目の商品名が設定されていません。');
147 147
                             return $this->render($app, $form, $headers, $this->productTwig);
148 148
                         } else {
149 149
                             $Product->setName(Str::trimAll($row['商品名']));
@@ -182,10 +182,10 @@  discard block
 block discarded – undo
182 182
                         if ($row['商品削除フラグ'] == '') {
183 183
                             $Product->setDelFlg(Constant::DISABLED);
184 184
                         } else {
185
-                            if ($row['商品削除フラグ'] == (string)Constant::DISABLED || $row['商品削除フラグ'] == (string)Constant::ENABLED) {
185
+                            if ($row['商品削除フラグ'] == (string) Constant::DISABLED || $row['商品削除フラグ'] == (string) Constant::ENABLED) {
186 186
                                 $Product->setDelFlg($row['商品削除フラグ']);
187 187
                             } else {
188
-                                $this->addErrors(($data->key() + 1) . '行目の商品削除フラグが設定されていません。');
188
+                                $this->addErrors(($data->key() + 1).'行目の商品削除フラグが設定されていません。');
189 189
                                 return $this->render($app, $form, $headers, $this->productTwig);
190 190
                             }
191 191
                         }
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
                                     if (is_numeric($deliveryFee) && $deliveryFee >= 0) {
211 211
                                         $ProductClassOrg->setDeliveryFee($deliveryFee);
212 212
                                     } else {
213
-                                        $this->addErrors(($data->key() + 1) . '行目の送料は0以上の数値を設定してください。');
213
+                                        $this->addErrors(($data->key() + 1).'行目の送料は0以上の数値を設定してください。');
214 214
                                     }
215 215
                                 }
216 216
                             }
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
                             if ($row['規格分類1(ID)'] != '') {
219 219
 
220 220
                                 if ($row['規格分類1(ID)'] == $row['規格分類2(ID)']) {
221
-                                    $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)と規格分類2(ID)には同じ値を使用できません。');
221
+                                    $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)と規格分類2(ID)には同じ値を使用できません。');
222 222
                                 } else {
223 223
                                     // 商品規格あり
224 224
                                     // 企画分類あり商品を作成
@@ -233,30 +233,30 @@  discard block
 block discarded – undo
233 233
                                     if (is_numeric($row['規格分類1(ID)'])) {
234 234
                                         $ClassCategory1 = $app['eccube.repository.class_category']->find($row['規格分類1(ID)']);
235 235
                                         if (!$ClassCategory1) {
236
-                                            $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。');
236
+                                            $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。');
237 237
                                         } else {
238 238
                                             $ProductClass->setClassCategory1($ClassCategory1);
239 239
                                         }
240 240
                                     } else {
241
-                                        $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。');
241
+                                        $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。');
242 242
                                     }
243 243
 
244 244
                                     if ($row['規格分類2(ID)'] != '') {
245 245
                                         if (is_numeric($row['規格分類2(ID)'])) {
246 246
                                             $ClassCategory2 = $app['eccube.repository.class_category']->find($row['規格分類2(ID)']);
247 247
                                             if (!$ClassCategory2) {
248
-                                                $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。');
248
+                                                $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。');
249 249
                                             } else {
250 250
                                                 if ($ClassCategory1 &&
251 251
                                                     ($ClassCategory1->getClassName()->getId() == $ClassCategory2->getClassName()->getId())
252 252
                                                 ) {
253
-                                                    $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)と規格分類2(ID)の規格名が同じです。');
253
+                                                    $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)と規格分類2(ID)の規格名が同じです。');
254 254
                                                 } else {
255 255
                                                     $ProductClass->setClassCategory2($ClassCategory2);
256 256
                                                 }
257 257
                                             }
258 258
                                         } else {
259
-                                            $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。');
259
+                                            $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。');
260 260
                                         }
261 261
                                     }
262 262
                                     $ProductClass->setProductStock($ProductStock);
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 
269 269
                             } else {
270 270
                                 if ($row['規格分類2(ID)'] != '') {
271
-                                    $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。');
271
+                                    $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。');
272 272
                                 }
273 273
                             }
274 274
 
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
                                             if (is_numeric($deliveryFee) && $deliveryFee >= 0) {
297 297
                                                 $pc->setDeliveryFee($deliveryFee);
298 298
                                             } else {
299
-                                                $this->addErrors(($data->key() + 1) . '行目の送料は0以上の数値を設定してください。');
299
+                                                $this->addErrors(($data->key() + 1).'行目の送料は0以上の数値を設定してください。');
300 300
                                             }
301 301
                                         }
302 302
                                     }
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
                                 }
319 319
 
320 320
                                 if ($row['規格分類1(ID)'] == $row['規格分類2(ID)']) {
321
-                                    $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)と規格分類2(ID)には同じ値を使用できません。');
321
+                                    $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)と規格分類2(ID)には同じ値を使用できません。');
322 322
                                 } else {
323 323
 
324 324
                                     // 必ず規格分類1がセットされている
@@ -327,36 +327,36 @@  discard block
 block discarded – undo
327 327
                                     if (is_numeric($classCategoryId1)) {
328 328
                                         $ClassCategory1 = $app['eccube.repository.class_category']->find($classCategoryId1);
329 329
                                         if (!$ClassCategory1) {
330
-                                            $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。');
330
+                                            $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。');
331 331
                                         }
332 332
                                     } else {
333
-                                        $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。');
333
+                                        $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。');
334 334
                                     }
335 335
 
336 336
                                     $ClassCategory2 = null;
337 337
                                     if ($row['規格分類2(ID)'] != '') {
338 338
                                         if ($pc->getClassCategory1() != null && $pc->getClassCategory2() == null) {
339
-                                            $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)は設定できません。');
339
+                                            $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)は設定できません。');
340 340
                                         } else {
341 341
                                             if (is_numeric($classCategoryId2)) {
342 342
                                                 $ClassCategory2 = $app['eccube.repository.class_category']->find($classCategoryId2);
343 343
                                                 if (!$ClassCategory2) {
344
-                                                    $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。');
344
+                                                    $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。');
345 345
                                                 } else {
346 346
                                                     if ($ClassCategory1 &&
347 347
                                                         ($ClassCategory1->getClassName()->getId() == $ClassCategory2->getClassName()->getId())
348 348
                                                     ) {
349
-                                                        $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)と規格分類2(ID)の規格名が同じです。');
349
+                                                        $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)と規格分類2(ID)の規格名が同じです。');
350 350
                                                     }
351 351
                                                 }
352 352
                                             } else {
353
-                                                $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。');
353
+                                                $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。');
354 354
                                             }
355 355
 
356 356
                                         }
357 357
                                     } else {
358 358
                                         if ($pc->getClassCategory1() != null && $pc->getClassCategory2() != null) {
359
-                                            $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)に値を設定してください。');
359
+                                            $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)に値を設定してください。');
360 360
                                         }
361 361
                                     }
362 362
                                     $ProductClass = $this->createProductClass($row, $Product, $app, $data, $ClassCategory1, $ClassCategory2);
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
                                             if (is_numeric($deliveryFee) && $deliveryFee >= 0) {
368 368
                                                 $ProductClass->setDeliveryFee($deliveryFee);
369 369
                                             } else {
370
-                                                $this->addErrors(($data->key() + 1) . '行目の送料は0以上の数値を設定してください。');
370
+                                                $this->addErrors(($data->key() + 1).'行目の送料は0以上の数値を設定してください。');
371 371
                                             }
372 372
                                         }
373 373
                                     }
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
                     foreach ($data as $row) {
451 451
 
452 452
                         if ($headerSize != count($row)) {
453
-                            $this->addErrors(($data->key() + 1) . '行目のCSVフォーマットが一致しません。');
453
+                            $this->addErrors(($data->key() + 1).'行目のCSVフォーマットが一致しません。');
454 454
                             return $this->render($app, $form, $headers, $this->categoryTwig);
455 455
                         }
456 456
 
@@ -459,23 +459,23 @@  discard block
 block discarded – undo
459 459
                             $this->em->persist($Category);
460 460
                         } else {
461 461
                             if (!is_numeric($row['カテゴリID'])) {
462
-                                $this->addErrors(($data->key() + 1) . '行目のカテゴリIDが存在しません。');
462
+                                $this->addErrors(($data->key() + 1).'行目のカテゴリIDが存在しません。');
463 463
                                 return $this->render($app, $form, $headers, $this->categoryTwig);
464 464
                             }
465 465
                             $Category = $app['eccube.repository.category']->find($row['カテゴリID']);
466 466
                             if (!$Category) {
467
-                                $this->addErrors(($data->key() + 1) . '行目のカテゴリIDが存在しません。');
467
+                                $this->addErrors(($data->key() + 1).'行目のカテゴリIDが存在しません。');
468 468
                                 return $this->render($app, $form, $headers, $this->categoryTwig);
469 469
                             }
470 470
                             if ($row['カテゴリID'] == $row['親カテゴリID']) {
471
-                                $this->addErrors(($data->key() + 1) . '行目のカテゴリIDと親カテゴリIDが同じです。');
471
+                                $this->addErrors(($data->key() + 1).'行目のカテゴリIDと親カテゴリIDが同じです。');
472 472
                                 return $this->render($app, $form, $headers, $this->categoryTwig);
473 473
                             }
474 474
 
475 475
                         }
476 476
 
477 477
                         if (Str::isBlank($row['カテゴリ名'])) {
478
-                            $this->addErrors(($data->key() + 1) . '行目のカテゴリ名が設定されていません。');
478
+                            $this->addErrors(($data->key() + 1).'行目のカテゴリ名が設定されていません。');
479 479
                             return $this->render($app, $form, $headers, $this->categoryTwig);
480 480
                         } else {
481 481
                             $Category->setName(Str::trimAll($row['カテゴリ名']));
@@ -484,13 +484,13 @@  discard block
 block discarded – undo
484 484
                         if ($row['親カテゴリID'] != '') {
485 485
 
486 486
                             if (!is_numeric($row['親カテゴリID'])) {
487
-                                $this->addErrors(($data->key() + 1) . '行目の親カテゴリIDが存在しません。');
487
+                                $this->addErrors(($data->key() + 1).'行目の親カテゴリIDが存在しません。');
488 488
                                 return $this->render($app, $form, $headers, $this->categoryTwig);
489 489
                             }
490 490
 
491 491
                             $ParentCategory = $app['eccube.repository.category']->find($row['親カテゴリID']);
492 492
                             if (!$ParentCategory) {
493
-                                $this->addErrors(($data->key() + 1) . '行目の親カテゴリIDが存在しません。');
493
+                                $this->addErrors(($data->key() + 1).'行目の親カテゴリIDが存在しません。');
494 494
                                 return $this->render($app, $form, $headers, $this->categoryTwig);
495 495
                             }
496 496
 
@@ -506,14 +506,14 @@  discard block
 block discarded – undo
506 506
                         }
507 507
 
508 508
                         if ($app['config']['category_nest_level'] < $Category->getLevel()) {
509
-                            $this->addErrors(($data->key() + 1) . '行目のカテゴリが最大レベルを超えているため設定できません。');
509
+                            $this->addErrors(($data->key() + 1).'行目のカテゴリが最大レベルを超えているため設定できません。');
510 510
                             return $this->render($app, $form, $headers, $this->categoryTwig);
511 511
                         }
512 512
 
513 513
                         $status = $app['eccube.repository.category']->save($Category);
514 514
 
515 515
                         if (!$status) {
516
-                            $this->addErrors(($data->key() + 1) . '行目のカテゴリが設定できません。');
516
+                            $this->addErrors(($data->key() + 1).'行目のカテゴリが設定できません。');
517 517
                         }
518 518
 
519 519
                         if ($this->hasErrors()) {
@@ -556,7 +556,7 @@  discard block
 block discarded – undo
556 556
             throw new NotFoundHttpException();
557 557
         }
558 558
 
559
-        $response->setCallback(function () use ($app, $request, $headers) {
559
+        $response->setCallback(function() use ($app, $request, $headers) {
560 560
 
561 561
             // ヘッダ行の出力
562 562
             $row = array();
@@ -571,7 +571,7 @@  discard block
 block discarded – undo
571 571
         });
572 572
 
573 573
         $response->headers->set('Content-Type', 'application/octet-stream');
574
-        $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename);
574
+        $response->headers->set('Content-Disposition', 'attachment; filename='.$filename);
575 575
         $response->send();
576 576
 
577 577
         return $response;
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
         if (!empty($this->fileName)) {
595 595
             try {
596 596
                 $fs = new Filesystem();
597
-                $fs->remove($app['config']['csv_temp_realdir'] . '/' . $this->fileName);
597
+                $fs->remove($app['config']['csv_temp_realdir'].'/'.$this->fileName);
598 598
             } catch (\Exception $e) {
599 599
                 // エラーが発生しても無視する
600 600
             }
@@ -617,10 +617,10 @@  discard block
 block discarded – undo
617 617
     protected function getImportData($app, $formFile)
618 618
     {
619 619
         // アップロードされたCSVファイルを一時ディレクトリに保存
620
-        $this->fileName = 'upload_' . Str::random() . '.' . $formFile->getClientOriginalExtension();
620
+        $this->fileName = 'upload_'.Str::random().'.'.$formFile->getClientOriginalExtension();
621 621
         $formFile->move($app['config']['csv_temp_realdir'], $this->fileName);
622 622
 
623
-        $file = file_get_contents($app['config']['csv_temp_realdir'] . '/' . $this->fileName);
623
+        $file = file_get_contents($app['config']['csv_temp_realdir'].'/'.$this->fileName);
624 624
         // アップロードされたファイルがUTF-8以外は文字コード変換を行う
625 625
         $encode = Str::characterEncoding(substr($file, 0, 6));
626 626
         if ($encode != 'UTF-8') {
@@ -699,7 +699,7 @@  discard block
 block discarded – undo
699 699
                 if (is_numeric($category)) {
700 700
                     $Category = $app['eccube.repository.category']->find($category);
701 701
                     if (!$Category) {
702
-                        $this->addErrors(($data->key() + 1) . '行目の商品カテゴリ(ID)「' . $category . '」が存在しません。');
702
+                        $this->addErrors(($data->key() + 1).'行目の商品カテゴリ(ID)「'.$category.'」が存在しません。');
703 703
                     } else {
704 704
                         $ProductCategory = new ProductCategory();
705 705
                         $ProductCategory->setProductId($Product->getId());
@@ -712,7 +712,7 @@  discard block
 block discarded – undo
712 712
                         $this->em->persist($ProductCategory);
713 713
                     }
714 714
                 } else {
715
-                    $this->addErrors(($data->key() + 1) . '行目の商品カテゴリ(ID)「' . $category . '」が存在しません。');
715
+                    $this->addErrors(($data->key() + 1).'行目の商品カテゴリ(ID)「'.$category.'」が存在しません。');
716 716
                 }
717 717
             }
718 718
 
@@ -732,17 +732,17 @@  discard block
 block discarded – undo
732 732
 
733 733
 
734 734
         if ($row['商品種別(ID)'] == '') {
735
-            $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が設定されていません。');
735
+            $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が設定されていません。');
736 736
         } else {
737 737
             if (is_numeric($row['商品種別(ID)'])) {
738 738
                 $ProductType = $app['eccube.repository.master.product_type']->find($row['商品種別(ID)']);
739 739
                 if (!$ProductType) {
740
-                    $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。');
740
+                    $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。');
741 741
                 } else {
742 742
                     $ProductClass->setProductType($ProductType);
743 743
                 }
744 744
             } else {
745
-                $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。');
745
+                $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。');
746 746
             }
747 747
         }
748 748
 
@@ -753,12 +753,12 @@  discard block
 block discarded – undo
753 753
             if (is_numeric($row['発送日目安(ID)'])) {
754 754
                 $DeliveryDate = $app['eccube.repository.delivery_date']->find($row['発送日目安(ID)']);
755 755
                 if (!$DeliveryDate) {
756
-                    $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。');
756
+                    $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。');
757 757
                 } else {
758 758
                     $ProductClass->setDeliveryDate($DeliveryDate);
759 759
                 }
760 760
             } else {
761
-                $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。');
761
+                $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。');
762 762
             }
763 763
         }
764 764
 
@@ -769,19 +769,19 @@  discard block
 block discarded – undo
769 769
         }
770 770
 
771 771
         if ($row['在庫数無制限フラグ'] == '') {
772
-            $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。');
772
+            $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。');
773 773
         } else {
774 774
             if ($row['在庫数無制限フラグ'] == (string) Constant::DISABLED) {
775 775
                 $ProductClass->setStockUnlimited(Constant::DISABLED);
776 776
                 // 在庫数が設定されていなければエラー
777 777
                 if ($row['在庫数'] == '') {
778
-                    $this->addErrors(($data->key() + 1) . '行目の在庫数が設定されていません。');
778
+                    $this->addErrors(($data->key() + 1).'行目の在庫数が設定されていません。');
779 779
                 } else {
780 780
                     $stock = str_replace(',', '', $row['在庫数']);
781 781
                     if (is_numeric($stock) && $stock >= 0) {
782 782
                         $ProductClass->setStock($stock);
783 783
                     } else {
784
-                        $this->addErrors(($data->key() + 1) . '行目の在庫数は0以上の数値を設定してください。');
784
+                        $this->addErrors(($data->key() + 1).'行目の在庫数は0以上の数値を設定してください。');
785 785
                     }
786 786
                 }
787 787
 
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
                 $ProductClass->setStockUnlimited(Constant::ENABLED);
790 790
                 $ProductClass->setStock(null);
791 791
             } else {
792
-                $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。');
792
+                $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。');
793 793
             }
794 794
         }
795 795
 
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
             if (is_numeric($saleLimit) && $saleLimit >= 0) {
799 799
                 $ProductClass->setSaleLimit($saleLimit);
800 800
             } else {
801
-                $this->addErrors(($data->key() + 1) . '行目の販売制限数は0以上の数値を設定してください。');
801
+                $this->addErrors(($data->key() + 1).'行目の販売制限数は0以上の数値を設定してください。');
802 802
             }
803 803
         }
804 804
 
@@ -807,18 +807,18 @@  discard block
 block discarded – undo
807 807
             if (is_numeric($price01) && $price01 >= 0) {
808 808
                 $ProductClass->setPrice01($price01);
809 809
             } else {
810
-                $this->addErrors(($data->key() + 1) . '行目の通常価格は0以上の数値を設定してください。');
810
+                $this->addErrors(($data->key() + 1).'行目の通常価格は0以上の数値を設定してください。');
811 811
             }
812 812
         }
813 813
 
814 814
         if ($row['販売価格'] == '') {
815
-            $this->addErrors(($data->key() + 1) . '行目の販売価格が設定されていません。');
815
+            $this->addErrors(($data->key() + 1).'行目の販売価格が設定されていません。');
816 816
         } else {
817 817
             $price02 = str_replace(',', '', $row['販売価格']);
818 818
             if (is_numeric($price02) && $price02 >= 0) {
819 819
                 $ProductClass->setPrice02($price02);
820 820
             } else {
821
-                $this->addErrors(($data->key() + 1) . '行目の販売価格は0以上の数値を設定してください。');
821
+                $this->addErrors(($data->key() + 1).'行目の販売価格は0以上の数値を設定してください。');
822 822
             }
823 823
         }
824 824
 
@@ -827,7 +827,7 @@  discard block
 block discarded – undo
827 827
             if (is_numeric($delivery_fee) && $delivery_fee >= 0) {
828 828
                 $ProductClass->setDeliveryFee($delivery_fee);
829 829
             } else {
830
-                $this->addErrors(($data->key() + 1) . '行目の送料は0以上の数値を設定してください。');
830
+                $this->addErrors(($data->key() + 1).'行目の送料は0以上の数値を設定してください。');
831 831
             }
832 832
         }
833 833
 
@@ -837,7 +837,7 @@  discard block
 block discarded – undo
837 837
             if ($row['商品規格削除フラグ'] == (string) Constant::DISABLED || $row['商品規格削除フラグ'] == (string) Constant::ENABLED) {
838 838
                 $ProductClass->setDelFlg($row['商品規格削除フラグ']);
839 839
             } else {
840
-                $this->addErrors(($data->key() + 1) . '行目の商品規格削除フラグが設定されていません。');
840
+                $this->addErrors(($data->key() + 1).'行目の商品規格削除フラグが設定されていません。');
841 841
             }
842 842
         }
843 843
 
@@ -870,17 +870,17 @@  discard block
 block discarded – undo
870 870
         $ProductClass->setProduct($Product);
871 871
 
872 872
         if ($row['商品種別(ID)'] == '') {
873
-            $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が設定されていません。');
873
+            $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が設定されていません。');
874 874
         } else {
875 875
             if (is_numeric($row['商品種別(ID)'])) {
876 876
                 $ProductType = $app['eccube.repository.master.product_type']->find($row['商品種別(ID)']);
877 877
                 if (!$ProductType) {
878
-                    $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。');
878
+                    $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。');
879 879
                 } else {
880 880
                     $ProductClass->setProductType($ProductType);
881 881
                 }
882 882
             } else {
883
-                $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。');
883
+                $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。');
884 884
             }
885 885
         }
886 886
 
@@ -889,12 +889,12 @@  discard block
 block discarded – undo
889 889
             if (is_numeric($row['規格分類1(ID)'])) {
890 890
                 $ClassCategory = $app['eccube.repository.class_category']->find($row['規格分類1(ID)']);
891 891
                 if (!$ClassCategory) {
892
-                    $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。');
892
+                    $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。');
893 893
                 } else {
894 894
                     $ProductClass->setClassCategory1($ClassCategory);
895 895
                 }
896 896
             } else {
897
-                $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。');
897
+                $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。');
898 898
             }
899 899
         }
900 900
 
@@ -902,12 +902,12 @@  discard block
 block discarded – undo
902 902
             if (is_numeric($row['規格分類2(ID)'])) {
903 903
                 $ClassCategory = $app['eccube.repository.class_category']->find($row['規格分類2(ID)']);
904 904
                 if (!$ClassCategory) {
905
-                    $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。');
905
+                    $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。');
906 906
                 } else {
907 907
                     $ProductClass->setClassCategory2($ClassCategory);
908 908
                 }
909 909
             } else {
910
-                $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。');
910
+                $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。');
911 911
             }
912 912
         }
913 913
 
@@ -915,12 +915,12 @@  discard block
 block discarded – undo
915 915
             if (is_numeric($row['発送日目安(ID)'])) {
916 916
                 $DeliveryDate = $app['eccube.repository.delivery_date']->find($row['発送日目安(ID)']);
917 917
                 if (!$DeliveryDate) {
918
-                    $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。');
918
+                    $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。');
919 919
                 } else {
920 920
                     $ProductClass->setDeliveryDate($DeliveryDate);
921 921
                 }
922 922
             } else {
923
-                $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。');
923
+                $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。');
924 924
             }
925 925
         }
926 926
 
@@ -931,19 +931,19 @@  discard block
 block discarded – undo
931 931
         }
932 932
 
933 933
         if ($row['在庫数無制限フラグ'] == '') {
934
-            $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。');
934
+            $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。');
935 935
         } else {
936 936
             if ($row['在庫数無制限フラグ'] == (string) Constant::DISABLED) {
937 937
                 $ProductClass->setStockUnlimited(Constant::DISABLED);
938 938
                 // 在庫数が設定されていなければエラー
939 939
                 if ($row['在庫数'] == '') {
940
-                    $this->addErrors(($data->key() + 1) . '行目の在庫数が設定されていません。');
940
+                    $this->addErrors(($data->key() + 1).'行目の在庫数が設定されていません。');
941 941
                 } else {
942 942
                     $stock = str_replace(',', '', $row['在庫数']);
943 943
                     if (is_numeric($stock) && $stock >= 0) {
944 944
                         $ProductClass->setStock($row['在庫数']);
945 945
                     } else {
946
-                        $this->addErrors(($data->key() + 1) . '行目の在庫数は0以上の数値を設定してください。');
946
+                        $this->addErrors(($data->key() + 1).'行目の在庫数は0以上の数値を設定してください。');
947 947
                     }
948 948
                 }
949 949
 
@@ -951,7 +951,7 @@  discard block
 block discarded – undo
951 951
                 $ProductClass->setStockUnlimited(Constant::ENABLED);
952 952
                 $ProductClass->setStock(null);
953 953
             } else {
954
-                $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。');
954
+                $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。');
955 955
             }
956 956
         }
957 957
 
@@ -960,7 +960,7 @@  discard block
 block discarded – undo
960 960
             if (is_numeric($saleLimit) && $saleLimit >= 0) {
961 961
                 $ProductClass->setSaleLimit($saleLimit);
962 962
             } else {
963
-                $this->addErrors(($data->key() + 1) . '行目の販売制限数は0以上の数値を設定してください。');
963
+                $this->addErrors(($data->key() + 1).'行目の販売制限数は0以上の数値を設定してください。');
964 964
             }
965 965
         }
966 966
 
@@ -969,18 +969,18 @@  discard block
 block discarded – undo
969 969
             if (is_numeric($price01) && $price01 >= 0) {
970 970
                 $ProductClass->setPrice01($price01);
971 971
             } else {
972
-                $this->addErrors(($data->key() + 1) . '行目の通常価格は0以上の数値を設定してください。');
972
+                $this->addErrors(($data->key() + 1).'行目の通常価格は0以上の数値を設定してください。');
973 973
             }
974 974
         }
975 975
 
976 976
         if ($row['販売価格'] == '') {
977
-            $this->addErrors(($data->key() + 1) . '行目の販売価格が設定されていません。');
977
+            $this->addErrors(($data->key() + 1).'行目の販売価格が設定されていません。');
978 978
         } else {
979 979
             $price02 = str_replace(',', '', $row['販売価格']);
980 980
             if (is_numeric($price02) && $price02 >= 0) {
981 981
                 $ProductClass->setPrice02($price02);
982 982
             } else {
983
-                $this->addErrors(($data->key() + 1) . '行目の販売価格は0以上の数値を設定してください。');
983
+                $this->addErrors(($data->key() + 1).'行目の販売価格は0以上の数値を設定してください。');
984 984
             }
985 985
         }
986 986
 
@@ -990,7 +990,7 @@  discard block
 block discarded – undo
990 990
             if ($row['商品規格削除フラグ'] == (string) Constant::DISABLED || $row['商品規格削除フラグ'] == (string) Constant::ENABLED) {
991 991
                 $ProductClass->setDelFlg($row['商品規格削除フラグ']);
992 992
             } else {
993
-                $this->addErrors(($data->key() + 1) . '行目の商品規格削除フラグが設定されていません。');
993
+                $this->addErrors(($data->key() + 1).'行目の商品規格削除フラグが設定されていません。');
994 994
             }
995 995
         }
996 996
 
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Store/TemplateController.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,6 @@
 block discarded – undo
28 28
 use Eccube\Entity\Master\DeviceType;
29 29
 use Eccube\Util\Str;
30 30
 use Symfony\Component\Filesystem\Filesystem;
31
-use Symfony\Component\Finder\Finder;
32 31
 use Symfony\Component\Form\FormError;
33 32
 use Symfony\Component\HttpFoundation\Request;
34 33
 use Symfony\Component\HttpFoundation\Response;
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -65,15 +65,15 @@  discard block
 block discarded – undo
65 65
                     ->find($form['selected']->getData());
66 66
 
67 67
                 // path.ymlの再構築
68
-                $file = $app['config']['root_dir'] . '/app/config/eccube/path.yml';
68
+                $file = $app['config']['root_dir'].'/app/config/eccube/path.yml';
69 69
                 $config = Yaml::parse($file);
70 70
 
71 71
                 $templateCode = $Template->getCode();
72 72
                 $config['template_code'] = $templateCode;
73
-                $config['template_realdir'] = $config['root_dir'] . '/app/template/' . $templateCode;
74
-                $config['template_html_realdir'] = $config['root_dir'] . '/html/template/' . $templateCode;
75
-                $config['front_urlpath'] = $config['root_urlpath'] . '/template/' . $templateCode;
76
-                $config['block_realdir'] =$config['template_realdir'] . '/Block';
73
+                $config['template_realdir'] = $config['root_dir'].'/app/template/'.$templateCode;
74
+                $config['template_html_realdir'] = $config['root_dir'].'/html/template/'.$templateCode;
75
+                $config['front_urlpath'] = $config['root_urlpath'].'/template/'.$templateCode;
76
+                $config['block_realdir'] = $config['template_realdir'].'/Block';
77 77
 
78 78
                 file_put_contents($file, Yaml::dump($config));
79 79
 
@@ -108,19 +108,19 @@  discard block
 block discarded – undo
108 108
         // 該当テンプレートのディレクトリ
109 109
         $config = $app['config'];
110 110
         $templateCode = $Template->getCode();
111
-        $targetRealDir = $config['root_dir'] . '/app/template/' . $templateCode;
112
-        $targetHtmlRealDir = $config['root_dir'] . '/html/template/' . $templateCode;
111
+        $targetRealDir = $config['root_dir'].'/app/template/'.$templateCode;
112
+        $targetHtmlRealDir = $config['root_dir'].'/html/template/'.$templateCode;
113 113
 
114 114
         // 一時ディレクトリ
115 115
         $uniqId = sha1(Str::random(32));
116
-        $tmpDir = $config['template_temp_realdir'] . '/' . $uniqId;
117
-        $appDir = $tmpDir . '/app';
118
-        $htmlDir = $tmpDir . '/html';
116
+        $tmpDir = $config['template_temp_realdir'].'/'.$uniqId;
117
+        $appDir = $tmpDir.'/app';
118
+        $htmlDir = $tmpDir.'/html';
119 119
 
120 120
         // ファイル名
121
-        $tarFile = $config['template_temp_realdir'] . '/' . $uniqId . '.tar';
122
-        $tarGzFile = $tarFile . '.gz';
123
-        $downloadFileName = $Template->getCode() . '.tar.gz';
121
+        $tarFile = $config['template_temp_realdir'].'/'.$uniqId.'.tar';
122
+        $tarGzFile = $tarFile.'.gz';
123
+        $downloadFileName = $Template->getCode().'.tar.gz';
124 124
 
125 125
         // 該当テンプレートを一時ディレクトリへコピーする.
126 126
         $fs = new Filesystem();
@@ -140,14 +140,14 @@  discard block
 block discarded – undo
140 140
 
141 141
         // ダウンロード完了後にファイルを削除する.
142 142
         // http://stackoverflow.com/questions/15238897/removing-file-after-delivering-response-with-silex-symfony
143
-        $app->finish(function (Request $request, Response $response, \Silex\Application $app) use (
143
+        $app->finish(function(Request $request, Response $response, \Silex\Application $app) use (
144 144
             $tmpDir,
145 145
             $tarFile,
146 146
             $tarGzFile
147 147
         ) {
148
-            $app['monolog']->addDebug('remove temp file: ' . $tmpDir);
149
-            $app['monolog']->addDebug('remove temp file: ' . $tarFile);
150
-            $app['monolog']->addDebug('remove temp file: ' . $tarGzFile);
148
+            $app['monolog']->addDebug('remove temp file: '.$tmpDir);
149
+            $app['monolog']->addDebug('remove temp file: '.$tarFile);
150
+            $app['monolog']->addDebug('remove temp file: '.$tarGzFile);
151 151
             $fs = new Filesystem();
152 152
             $fs->remove($tmpDir);
153 153
             $fs->remove($tarFile);
@@ -188,8 +188,8 @@  discard block
 block discarded – undo
188 188
         // テンプレートディレクトリの削除
189 189
         $config = $app['config'];
190 190
         $templateCode = $Template->getCode();
191
-        $targetRealDir = $config['root_dir'] . '/app/template/' . $templateCode;
192
-        $targetHtmlRealDir = $config['root_dir'] . '/html/template/' . $templateCode;
191
+        $targetRealDir = $config['root_dir'].'/app/template/'.$templateCode;
192
+        $targetHtmlRealDir = $config['root_dir'].'/html/template/'.$templateCode;
193 193
 
194 194
         $fs = new Filesystem();
195 195
         $fs->remove($targetRealDir);
@@ -232,18 +232,18 @@  discard block
 block discarded – undo
232 232
                 // 該当テンプレートのディレクトリ
233 233
                 $config = $app['config'];
234 234
                 $templateCode = $Template->getCode();
235
-                $targetRealDir = $config['root_dir'] . '/app/template/' . $templateCode;
236
-                $targetHtmlRealDir = $config['root_dir'] . '/html/template/' . $templateCode;
235
+                $targetRealDir = $config['root_dir'].'/app/template/'.$templateCode;
236
+                $targetHtmlRealDir = $config['root_dir'].'/html/template/'.$templateCode;
237 237
 
238 238
                 // 一時ディレクトリ
239 239
                 $uniqId = sha1(Str::random(32));
240
-                $tmpDir = $config['template_temp_realdir'] . '/' . $uniqId;
241
-                $appDir = $tmpDir . '/app';
242
-                $htmlDir = $tmpDir . '/html';
240
+                $tmpDir = $config['template_temp_realdir'].'/'.$uniqId;
241
+                $appDir = $tmpDir.'/app';
242
+                $htmlDir = $tmpDir.'/html';
243 243
 
244 244
                 $formFile = $form['file']->getData();
245 245
                 // ファイル名
246
-                $archive = $templateCode . '.' . $formFile->getClientOriginalExtension();
246
+                $archive = $templateCode.'.'.$formFile->getClientOriginalExtension();
247 247
 
248 248
                 // ファイルを一時ディレクトリへ移動.
249 249
                 $formFile->move($tmpDir, $archive);
@@ -252,11 +252,11 @@  discard block
 block discarded – undo
252 252
                 try {
253 253
                     if ($formFile->getClientOriginalExtension() == 'zip') {
254 254
                         $zip = new \ZipArchive();
255
-                        $zip->open($tmpDir . '/' . $archive);
255
+                        $zip->open($tmpDir.'/'.$archive);
256 256
                         $zip->extractTo($tmpDir);
257 257
                         $zip->close();
258 258
                     } else {
259
-                        $phar = new \PharData($tmpDir . '/' . $archive);
259
+                        $phar = new \PharData($tmpDir.'/'.$archive);
260 260
                         $phar->extractTo($tmpDir, null, true);
261 261
                     }
262 262
                 } catch (\Exception $e) {
Please login to merge, or discard this patch.
src/Eccube/Controller/Install/InstallController.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -250,6 +250,9 @@
 block discarded – undo
250 250
     }
251 251
 
252 252
 
253
+    /**
254
+     * @param InstallApplication $app
255
+     */
253 256
     private function checkModules($app)
254 257
     {
255 258
         foreach ($this->required_modules as $module) {
Please login to merge, or discard this patch.
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
 
61 61
     public function __construct()
62 62
     {
63
-        $this->config_path = __DIR__ . '/../../../../app/config/eccube';
64
-        $this->dist_path = __DIR__ . '/../../Resource/config';
65
-        $this->cache_path = __DIR__ . '/../../../../app/cache';
63
+        $this->config_path = __DIR__.'/../../../../app/config/eccube';
64
+        $this->dist_path = __DIR__.'/../../Resource/config';
65
+        $this->cache_path = __DIR__.'/../../../../app/cache';
66 66
     }
67 67
 
68 68
     private function isValid(Request $request, Form $form)
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
 
148 148
         if (empty($sessionData['shop_name'])) {
149 149
 
150
-            $config_file = $this->config_path . '/config.yml';
150
+            $config_file = $this->config_path.'/config.yml';
151 151
             $fs = new Filesystem();
152 152
 
153 153
             if ($fs->exists($config_file)) {
@@ -161,21 +161,21 @@  discard block
 block discarded – undo
161 161
                 }
162 162
 
163 163
                 // セキュリティの設定
164
-                $config_file = $this->config_path . '/path.yml';
164
+                $config_file = $this->config_path.'/path.yml';
165 165
                 $config = Yaml::parse(file_get_contents($config_file));
166 166
                 $sessionData['admin_dir'] = $config['admin_route'];
167 167
 
168
-                $config_file = $this->config_path . '/config.yml';
168
+                $config_file = $this->config_path.'/config.yml';
169 169
                 $config = Yaml::parse(file_get_contents($config_file));
170 170
 
171 171
                 $allowHost = $config['admin_allow_host'];
172 172
                 if (count($allowHost) > 0) {
173 173
                     $sessionData['admin_allow_hosts'] = Str::convertLineFeed(implode("\n", $allowHost));
174 174
                 }
175
-                $sessionData['admin_force_ssl'] = (bool)$config['force_ssl'];
175
+                $sessionData['admin_force_ssl'] = (bool) $config['force_ssl'];
176 176
 
177 177
                 // メール設定
178
-                $config_file = $this->config_path . '/mail.yml';
178
+                $config_file = $this->config_path.'/mail.yml';
179 179
                 $config = Yaml::parse(file_get_contents($config_file));
180 180
                 $mail = $config['mail'];
181 181
                 $sessionData['mail_backend'] = $mail['transport'];
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
                 $host = $request->getSchemeAndHttpHost();
286 286
                 $basePath = $request->getBasePath();
287 287
                 $params = array(
288
-                    'http_url' => $host . $basePath,
288
+                    'http_url' => $host.$basePath,
289 289
                     'shop_name' => $sessionData['shop_name'],
290 290
                 );
291 291
 
@@ -306,13 +306,13 @@  discard block
 block discarded – undo
306 306
     //    インストール完了
307 307
     public function complete(InstallApplication $app, Request $request)
308 308
     {
309
-        $config_file = $this->config_path . '/path.yml';
309
+        $config_file = $this->config_path.'/path.yml';
310 310
         $config = Yaml::parse(file_get_contents($config_file));
311 311
 
312 312
         $host = $request->getSchemeAndHttpHost();
313 313
         $basePath = $request->getBasePath();
314 314
 
315
-        $adminUrl = $host . $basePath . '/' . $config['admin_dir'];
315
+        $adminUrl = $host.$basePath.'/'.$config['admin_dir'];
316 316
 
317 317
         return $app['twig']->render('complete.twig', array(
318 318
             'admin_url' => $adminUrl,
@@ -332,17 +332,17 @@  discard block
 block discarded – undo
332 332
     {
333 333
         foreach ($this->required_modules as $module) {
334 334
             if (!extension_loaded($module)) {
335
-                $app->addDanger('[必須] ' . $module . ' 拡張モジュールが有効になっていません。', 'install');
335
+                $app->addDanger('[必須] '.$module.' 拡張モジュールが有効になっていません。', 'install');
336 336
             }
337 337
         }
338 338
 
339 339
         if (!extension_loaded('pdo_mysql') && !extension_loaded('pdo_pgsql')) {
340
-            $app->addDanger('[必須] ' . 'pdo_pgsql又はpdo_mysql 拡張モジュールを有効にしてください。', 'install');
340
+            $app->addDanger('[必須] '.'pdo_pgsql又はpdo_mysql 拡張モジュールを有効にしてください。', 'install');
341 341
         }
342 342
 
343 343
         foreach ($this->recommended_module as $module) {
344 344
             if (!extension_loaded($module)) {
345
-                $app->addWarning('[推奨] ' . $module . ' 拡張モジュールが有効になっていません。', 'install');
345
+                $app->addWarning('[推奨] '.$module.' 拡張モジュールが有効になっていません。', 'install');
346 346
             }
347 347
         }
348 348
 
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
             if (!function_exists('apache_get_modules')) {
361 361
                 $app->addWarning('mod_rewrite が有効になっているか不明です。', 'install');
362 362
             } elseif (!in_array('mod_rewrite', apache_get_modules())) {
363
-                $app->addDanger('[必須] ' . 'mod_rewriteを有効にしてください。', 'install');
363
+                $app->addDanger('[必須] '.'mod_rewriteを有効にしてください。', 'install');
364 364
             }
365 365
         } elseif (isset($_SERVER['SERVER_SOFTWARE']) && strpos('Microsoft-IIS', $_SERVER['SERVER_SOFTWARE']) !== false) {
366 366
             // iis
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
 
372 372
     private function setPDO()
373 373
     {
374
-        $config_file = $this->config_path . '/database.yml';
374
+        $config_file = $this->config_path.'/database.yml';
375 375
         $config = Yaml::parse(file_get_contents($config_file));
376 376
 
377 377
         try {
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
      */
407 407
     private function getEntityManager()
408 408
     {
409
-        $config_file = $this->config_path . '/database.yml';
409
+        $config_file = $this->config_path.'/database.yml';
410 410
         $database = Yaml::parse(file_get_contents($config_file));
411 411
 
412 412
         $this->app->register(new \Silex\Provider\DoctrineServiceProvider(), array(
@@ -414,15 +414,15 @@  discard block
 block discarded – undo
414 414
         ));
415 415
 
416 416
         $this->app->register(new \Dflydev\Silex\Provider\DoctrineOrm\DoctrineOrmServiceProvider(), array(
417
-            'orm.proxies_dir' => __DIR__ . '/../../app/cache/doctrine',
417
+            'orm.proxies_dir' => __DIR__.'/../../app/cache/doctrine',
418 418
             'orm.em.options' => array(
419 419
                 'mappings' => array(
420 420
                     array(
421 421
                         'type' => 'yml',
422 422
                         'namespace' => 'Eccube\Entity',
423 423
                         'path' => array(
424
-                            __DIR__ . '/../../Resource/doctrine',
425
-                            __DIR__ . '/../../Resource/doctrine/master',
424
+                            __DIR__.'/../../Resource/doctrine',
425
+                            __DIR__.'/../../Resource/doctrine/master',
426 426
                         ),
427 427
                     ),
428 428
 
@@ -450,11 +450,11 @@  discard block
 block discarded – undo
450 450
     {
451 451
         $this->resetNatTimer();
452 452
 
453
-        $config_file = $this->config_path . '/database.yml';
453
+        $config_file = $this->config_path.'/database.yml';
454 454
         $database = Yaml::parse(file_get_contents($config_file));
455 455
         $config['database'] = $database['database'];
456 456
 
457
-        $config_file = $this->config_path . '/config.yml';
457
+        $config_file = $this->config_path.'/config.yml';
458 458
         $baseConfig = Yaml::parse(file_get_contents($config_file));
459 459
         $config['config'] = $baseConfig;
460 460
 
@@ -510,11 +510,11 @@  discard block
 block discarded – undo
510 510
     {
511 511
         $this->resetNatTimer();
512 512
 
513
-        $config_file = $this->config_path . '/database.yml';
513
+        $config_file = $this->config_path.'/database.yml';
514 514
         $database = Yaml::parse(file_get_contents($config_file));
515 515
         $config['database'] = $database['database'];
516 516
 
517
-        $config_file = $this->config_path . '/config.yml';
517
+        $config_file = $this->config_path.'/config.yml';
518 518
         $baseConfig = Yaml::parse(file_get_contents($config_file));
519 519
         $config['config'] = $baseConfig;
520 520
 
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
         $config = new Configuration($app['db']);
580 580
         $config->setMigrationsNamespace('DoctrineMigrations');
581 581
 
582
-        $migrationDir = __DIR__ . '/../../Resource/doctrine/migration';
582
+        $migrationDir = __DIR__.'/../../Resource/doctrine/migration';
583 583
         $config->setMigrationsDirectory($migrationDir);
584 584
         $config->registerMigrationsFromDirectory($migrationDir);
585 585
 
@@ -610,7 +610,7 @@  discard block
 block discarded – undo
610 610
     private function getProtectedDirs()
611 611
     {
612 612
         $protectedDirs = array();
613
-        $base = __DIR__ . '/../../../..';
613
+        $base = __DIR__.'/../../../..';
614 614
         $dirs = array(
615 615
             '/html',
616 616
             '/app',
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
         );
624 624
 
625 625
         foreach ($dirs as $dir) {
626
-            if (!is_writable($base . $dir)) {
626
+            if (!is_writable($base.$dir)) {
627 627
                 $protectedDirs[] = $dir;
628 628
             }
629 629
         }
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
     private function createConfigYamlFile($data, $auth = true)
635 635
     {
636 636
         $fs = new Filesystem();
637
-        $config_file = $this->config_path . '/config.yml';
637
+        $config_file = $this->config_path.'/config.yml';
638 638
 
639 639
         if ($fs->exists($config_file)) {
640 640
             $config = Yaml::parse(file_get_contents($config_file));
@@ -665,7 +665,7 @@  discard block
 block discarded – undo
665 665
         $content = str_replace(
666 666
             $target,
667 667
             $replace,
668
-            file_get_contents($this->dist_path . '/config.yml.dist')
668
+            file_get_contents($this->dist_path.'/config.yml.dist')
669 669
         );
670 670
         $fs->dumpFile($config_file, $content);
671 671
 
@@ -679,7 +679,7 @@  discard block
 block discarded – undo
679 679
 
680 680
     private function addInstallStatus()
681 681
     {
682
-        $config_file = $this->config_path . '/config.yml';
682
+        $config_file = $this->config_path.'/config.yml';
683 683
         $config = Yaml::parse(file_get_contents($config_file));
684 684
         $config['eccube_install'] = 1;
685 685
         $yml = Yaml::dump($config);
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
     private function createDatabaseYamlFile($data)
692 692
     {
693 693
         $fs = new Filesystem();
694
-        $config_file = $this->config_path . '/database.yml';
694
+        $config_file = $this->config_path.'/database.yml';
695 695
         if ($fs->exists($config_file)) {
696 696
             $fs->remove($config_file);
697 697
         }
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
             $content = str_replace(
726 726
                 $target,
727 727
                 $replace,
728
-                file_get_contents($this->dist_path . '/database.yml.dist')
728
+                file_get_contents($this->dist_path.'/database.yml.dist')
729 729
             );
730 730
 
731 731
         } else {
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
     private function createMailYamlFile($data)
745 745
     {
746 746
         $fs = new Filesystem();
747
-        $config_file = $this->config_path . '/mail.yml';
747
+        $config_file = $this->config_path.'/mail.yml';
748 748
         if ($fs->exists($config_file)) {
749 749
             $fs->remove($config_file);
750 750
         }
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
         $content = str_replace(
762 762
             $target,
763 763
             $replace,
764
-            file_get_contents($this->dist_path . '/mail.yml.dist')
764
+            file_get_contents($this->dist_path.'/mail.yml.dist')
765 765
         );
766 766
         $fs->dumpFile($config_file, $content);
767 767
 
@@ -771,7 +771,7 @@  discard block
 block discarded – undo
771 771
     private function createPathYamlFile($data, Request $request)
772 772
     {
773 773
         $fs = new Filesystem();
774
-        $config_file = $this->config_path . '/path.yml';
774
+        $config_file = $this->config_path.'/path.yml';
775 775
         if ($fs->exists($config_file)) {
776 776
             $fs->remove($config_file);
777 777
         }
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
         $ADMIN_ROUTE = $data['admin_dir'];
780 780
         $TEMPLATE_CODE = 'default';
781 781
         $USER_DATA_ROUTE = 'user_data';
782
-        $ROOT_DIR = realpath(__DIR__ . '/../../../../');
782
+        $ROOT_DIR = realpath(__DIR__.'/../../../../');
783 783
         $ROOT_URLPATH = $request->getBasePath();
784 784
 
785 785
         $target = array('${ADMIN_ROUTE}', '${TEMPLATE_CODE}', '${USER_DATA_ROUTE}', '${ROOT_DIR}', '${ROOT_URLPATH}');
@@ -789,7 +789,7 @@  discard block
 block discarded – undo
789 789
         $content = str_replace(
790 790
             $target,
791 791
             $replace,
792
-            file_get_contents($this->dist_path . '/path.yml.dist')
792
+            file_get_contents($this->dist_path.'/path.yml.dist')
793 793
         );
794 794
         $fs->dumpFile($config_file, $content);
795 795
 
@@ -798,7 +798,7 @@  discard block
 block discarded – undo
798 798
 
799 799
     private function sendAppData($params)
800 800
     {
801
-        $config_file = $this->config_path . '/database.yml';
801
+        $config_file = $this->config_path.'/database.yml';
802 802
         $db_config = Yaml::parse(file_get_contents($config_file));
803 803
 
804 804
         $this->setPDO();
@@ -810,7 +810,7 @@  discard block
 block discarded – undo
810 810
         }
811 811
 
812 812
         if ($db_config['database']['driver'] === 'pdo_mysql') {
813
-            $db_ver = 'MySQL:' . $version;
813
+            $db_ver = 'MySQL:'.$version;
814 814
         } else {
815 815
             $db_ver = $version;
816 816
         }
@@ -828,7 +828,7 @@  discard block
 block discarded – undo
828 828
 
829 829
         $header = array(
830 830
             'Content-Type: application/x-www-form-urlencoded',
831
-            'Content-Length: ' . strlen($data),
831
+            'Content-Length: '.strlen($data),
832 832
         );
833 833
         $context = stream_context_create(
834 834
             array(
Please login to merge, or discard this patch.
src/Eccube/Controller/ShoppingController.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -1188,6 +1188,7 @@
 block discarded – undo
1188 1188
 
1189 1189
     /**
1190 1190
      * 非会員でのお客様情報変更時の入力チェック
1191
+     * @param Application $app
1191 1192
      */
1192 1193
     private function customerValidation($app, $data) {
1193 1194
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
 
222 222
             $MailHistory = new MailHistory();
223 223
             $MailHistory
224
-                ->setSubject('[' . $app['eccube.repository.base_info']->get()->getShopName() . '] ' . $MailTemplate->getSubject())
224
+                ->setSubject('['.$app['eccube.repository.base_info']->get()->getShopName().'] '.$MailTemplate->getSubject())
225 225
                 ->setMailBody($body)
226 226
                 ->setMailTemplate($MailTemplate)
227 227
                 ->setSendDate(new \DateTime())
@@ -634,7 +634,7 @@  discard block
 block discarded – undo
634 634
                     ->setTel03($data['customer_tel03'])
635 635
                     ->setZip01($data['customer_zip01'])
636 636
                     ->setZip02($data['customer_zip02'])
637
-                    ->setZipCode($data['customer_zip01'] . $data['customer_zip02'])
637
+                    ->setZipCode($data['customer_zip01'].$data['customer_zip02'])
638 638
                     ->setPref($pref)
639 639
                     ->setAddr01($data['customer_addr01'])
640 640
                     ->setAddr02($data['customer_addr02'])
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
                 ->setTel03($data['tel03'])
734 734
                 ->setZip01($data['zip01'])
735 735
                 ->setZip02($data['zip02'])
736
-                ->setZipCode($data['zip01'] . $data['zip02'])
736
+                ->setZipCode($data['zip01'].$data['zip02'])
737 737
                 ->setPref($data['pref'])
738 738
                 ->setAddr01($data['addr01'])
739 739
                 ->setAddr02($data['addr02']);
@@ -752,7 +752,7 @@  discard block
 block discarded – undo
752 752
                 ->setTel03($data['tel03'])
753 753
                 ->setZip01($data['zip01'])
754 754
                 ->setZip02($data['zip02'])
755
-                ->setZipCode($data['zip01'] . $data['zip02'])
755
+                ->setZipCode($data['zip01'].$data['zip02'])
756 756
                 ->setPref($data['pref'])
757 757
                 ->setAddr01($data['addr01'])
758 758
                 ->setAddr02($data['addr02'])
@@ -1070,7 +1070,7 @@  discard block
 block discarded – undo
1070 1070
 
1071 1071
         $errors[] = $app['validator']->validateValue($data['customer_name02'], array(
1072 1072
             new Assert\NotBlank(),
1073
-            new Assert\Length(array('max' => $app['config']['name_len'], )),
1073
+            new Assert\Length(array('max' => $app['config']['name_len'],)),
1074 1074
             new Assert\Regex(array('pattern' => '/^[^\s ]+$/u', 'message' => 'form.type.name.firstname.nothasspace'))
1075 1075
         ));
1076 1076
 
Please login to merge, or discard this patch.
src/Eccube/Form/DataTransformer/EntityToIdTransformer.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@
 block discarded – undo
42 42
 
43 43
     /**
44 44
      * @param ObjectManager $om
45
-     * @param stging $className
45
+     * @param string $className
46 46
      */
47 47
     public function __construct(ObjectManager $om, $className)
48 48
     {
Please login to merge, or discard this patch.