Failed Conditions
Pull Request — master (#1440)
by k-yamamura
77:21 queued 70:56
created
src/Eccube/Controller/Admin/Setting/System/LogController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
         $log = array();
63 63
         $message = array();
64 64
 
65
-        foreach (array_reverse(file($logFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES)) as $line) {
65
+        foreach (array_reverse(file($logFile, FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES)) as $line) {
66 66
             // 上限に達した場合、処理を抜ける
67 67
             if (count($log) >= $formData['line_max']) {
68 68
                 break;
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Setting/System/SecurityController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
                 // 現在のセキュリティ情報を更新
53 53
                 $adminRoot = $app['config']['admin_route'];
54 54
 
55
-                $configFile = $app['config']['root_dir'] . '/app/config/eccube/config.yml';
55
+                $configFile = $app['config']['root_dir'].'/app/config/eccube/config.yml';
56 56
                 $config = Yaml::parse(file_get_contents($configFile));
57 57
                 // trim処理
58 58
                 $allowHost = Str::convertLineFeed($data['admin_allow_host']);
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 
83 83
                 if ($adminRoot != $data['admin_route_dir']) {
84 84
                     // admin_routeが変更されればpath.ymlを更新
85
-                    $pathFile = $app['config']['root_dir'] . '/app/config/eccube/path.yml';
85
+                    $pathFile = $app['config']['root_dir'].'/app/config/eccube/path.yml';
86 86
                     $config = Yaml::parse(file_get_contents($pathFile));
87 87
                     $config['admin_route'] = $data['admin_route_dir'];
88 88
 
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
                     $this->getSecurity($app)->setToken(null);
95 95
 
96 96
                     // 管理者画面へ再ログイン
97
-                    return $app->redirect($request->getBaseUrl() . '/' . $config['admin_route']);
97
+                    return $app->redirect($request->getBaseUrl().'/'.$config['admin_route']);
98 98
                 }
99 99
 
100 100
                 $app->addSuccess('admin.sysmte.security.save.complete', 'admin');
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
             if (count($allowHost) > 0) {
108 108
                 $form->get('admin_allow_host')->setData(Str::convertLineFeed(implode("\n", $allowHost)));
109 109
             }
110
-            $form->get('force_ssl')->setData((bool)$app['config']['force_ssl']);
110
+            $form->get('force_ssl')->setData((bool) $app['config']['force_ssl']);
111 111
         }
112 112
 
113 113
         return $app->render('Setting/System/security.twig', array(
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Setting/System/SystemController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -67,13 +67,13 @@
 block discarded – undo
67 67
         $server = $app['request'];
68 68
 
69 69
         $arrSystemInfo = array(
70
-            array('title' => 'EC-CUBE',     'value' => Constant::VERSION),
71
-            array('title' => 'サーバーOS',    'value' => php_uname()),
72
-            array('title' => 'DBサーバー',    'value' => $system->getDbversion()),
73
-            array('title' => 'WEBサーバー',   'value' => $server->server->get("SERVER_SOFTWARE")),
70
+            array('title' => 'EC-CUBE', 'value' => Constant::VERSION),
71
+            array('title' => 'サーバーOS', 'value' => php_uname()),
72
+            array('title' => 'DBサーバー', 'value' => $system->getDbversion()),
73
+            array('title' => 'WEBサーバー', 'value' => $server->server->get("SERVER_SOFTWARE")),
74 74
         );
75 75
 
76
-        $value = phpversion() . ' (' . implode(', ', get_loaded_extensions()) . ')';
76
+        $value = phpversion().' ('.implode(', ', get_loaded_extensions()).')';
77 77
         $arrSystemInfo[] = array('title' => 'PHP', 'value' => $value);
78 78
         $arrSystemInfo[] = array('title' => 'HTTPユーザーエージェント', 'value' => $server->headers->get('User-Agent'));
79 79
 
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Store/PluginController.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
         foreach ($Plugins as $Plugin) {
59 59
 
60 60
             $form = $app['form.factory']
61
-                ->createNamedBuilder('form' . $Plugin->getId(), 'plugin_management', null, array(
61
+                ->createNamedBuilder('form'.$Plugin->getId(), 'plugin_management', null, array(
62 62
                     'plugin_id' => $Plugin->getId(),
63 63
                 ))
64 64
                 ->getForm();
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
             try {
69 69
                 // プラグイン用設定画面があれば表示(プラグイン用のサービスプロバイダーに定義されているか)
70
-                $configPages[$Plugin->getCode()] = $app->url('plugin_' . $Plugin->getCode() . '_config');
70
+                $configPages[$Plugin->getCode()] = $app->url('plugin_'.$Plugin->getCode().'_config');
71 71
             } catch (\Exception $e) {
72 72
                 // プラグインで設定画面のルートが定義されていない場合は無視
73 73
             }
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
         if (!is_null($authKey)) {
90 90
 
91 91
             // オーナーズストア通信
92
-            $url = $app['config']['owners_store_url'] . '?method=list';
92
+            $url = $app['config']['owners_store_url'].'?method=list';
93 93
             list($json, $httpHeader) = $this->getRequestApi($request, $authKey, $url);
94 94
 
95 95
             if ($json) {
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
         $Plugin = $app['eccube.repository.plugin']->find($id);
151 151
 
152 152
         $form = $app['form.factory']
153
-            ->createNamedBuilder('form' . $id, 'plugin_management', null, array(
153
+            ->createNamedBuilder('form'.$id, 'plugin_management', null, array(
154 154
                 'plugin_id' => null, // placeHolder
155 155
             ))
156 156
             ->getForm();
@@ -168,10 +168,10 @@  discard block
 block discarded – undo
168 168
                     $formFile = $form['plugin_archive']->getData();
169 169
 
170 170
                     $tmpDir = $app['eccube.service.plugin']->createTempDir();
171
-                    $tmpFile = sha1(Str::random(32)) . '.' . $formFile->getClientOriginalExtension();
171
+                    $tmpFile = sha1(Str::random(32)).'.'.$formFile->getClientOriginalExtension();
172 172
 
173 173
                     $formFile->move($tmpDir, $tmpFile);
174
-                    $app['eccube.service.plugin']->update($Plugin, $tmpDir . '/' . $tmpFile);
174
+                    $app['eccube.service.plugin']->update($Plugin, $tmpDir.'/'.$tmpFile);
175 175
 
176 176
                     $fs = new Filesystem();
177 177
                     $fs->remove($tmpDir);
@@ -340,11 +340,11 @@  discard block
 block discarded – undo
340 340
                     $formFile = $form['plugin_archive']->getData();
341 341
 
342 342
                     $tmpDir = $service->createTempDir();
343
-                    $tmpFile = sha1(Str::random(32)) . '.' . $formFile->getClientOriginalExtension(); // 拡張子を付けないとpharが動かないので付ける
343
+                    $tmpFile = sha1(Str::random(32)).'.'.$formFile->getClientOriginalExtension(); // 拡張子を付けないとpharが動かないので付ける
344 344
 
345 345
                     $formFile->move($tmpDir, $tmpFile);
346 346
 
347
-                    $service->install($tmpDir . '/' . $tmpFile);
347
+                    $service->install($tmpDir.'/'.$tmpFile);
348 348
 
349 349
                     $fs = new Filesystem();
350 350
                     $fs->remove($tmpDir);
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
         if (!is_null($authKey)) {
392 392
 
393 393
             // オーナーズストア通信
394
-            $url = $app['config']['owners_store_url'] . '?method=list';
394
+            $url = $app['config']['owners_store_url'].'?method=list';
395 395
             list($json, $httpHeader) = $this->getRequestApi($request, $authKey, $url);
396 396
 
397 397
             if ($json === false) {
@@ -465,7 +465,7 @@  discard block
 block discarded – undo
465 465
                         }
466 466
 
467 467
                     } else {
468
-                        $message = $data['error_code'] . ' : ' . $data['error_message'];
468
+                        $message = $data['error_code'].' : '.$data['error_message'];
469 469
                     }
470 470
                 } else {
471 471
                     $success = 0;
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
         if (!is_null($authKey)) {
508 508
 
509 509
             // オーナーズストア通信
510
-            $url = $app['config']['owners_store_url'] . '?method=download&product_id=' . $id;
510
+            $url = $app['config']['owners_store_url'].'?method=download&product_id='.$id;
511 511
             list($json, $httpHeader) = $this->getRequestApi($request, $authKey, $url);
512 512
 
513 513
             if ($json === false) {
@@ -532,22 +532,22 @@  discard block
 block discarded – undo
532 532
                             $extension = pathinfo($item['file_name'], PATHINFO_EXTENSION);
533 533
 
534 534
                             $tmpDir = $service->createTempDir();
535
-                            $tmpFile = sha1(Str::random(32)) . '.' . $extension;
535
+                            $tmpFile = sha1(Str::random(32)).'.'.$extension;
536 536
 
537 537
                             // ファイル作成
538 538
                             $fs = new Filesystem();
539
-                            $fs->dumpFile($tmpDir . '/' . $tmpFile, $file);
539
+                            $fs->dumpFile($tmpDir.'/'.$tmpFile, $file);
540 540
 
541 541
                             if ($action == 'install') {
542 542
 
543
-                                $service->install($tmpDir . '/' . $tmpFile, $id);
543
+                                $service->install($tmpDir.'/'.$tmpFile, $id);
544 544
                                 $app->addSuccess('admin.plugin.install.complete', 'admin');
545 545
 
546 546
                             } else if ($action == 'update') {
547 547
 
548 548
                                 $Plugin = $app['eccube.repository.plugin']->findOneBy(array('source' => $id));
549 549
 
550
-                                $service->update($Plugin, $tmpDir . '/' . $tmpFile);
550
+                                $service->update($Plugin, $tmpDir.'/'.$tmpFile);
551 551
                                 $app->addSuccess('admin.plugin.update.complete', 'admin');
552 552
 
553 553
                                 Cache::clear($app, false);
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
                             $fs->remove($tmpDir);
559 559
 
560 560
                             // ダウンロード完了通知処理(正常終了時)
561
-                            $url = $app['config']['owners_store_url'] . '?method=commit&product_id=' . $id . '&status=1&version=' . $version;
561
+                            $url = $app['config']['owners_store_url'].'?method=commit&product_id='.$id.'&status=1&version='.$version;
562 562
                             $this->getRequestApi($request, $authKey, $url);
563 563
 
564 564
                             return $app->redirect($app->url('admin_store_plugin'));
@@ -572,7 +572,7 @@  discard block
 block discarded – undo
572 572
                         }
573 573
 
574 574
                     } else {
575
-                        $message = $data['error_code'] . ' : ' . $data['error_message'];
575
+                        $message = $data['error_code'].' : '.$data['error_message'];
576 576
                     }
577 577
                 } else {
578 578
                     $message = "EC-CUBEオーナーズストアにエラーが発生しています。";
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
         }
582 582
 
583 583
         // ダウンロード完了通知処理(エラー発生時)
584
-        $url = $app['config']['owners_store_url'] . '?method=commit&product_id=' . $id . '&status=0&version=' . $version . '&message=' . urlencode($message);
584
+        $url = $app['config']['owners_store_url'].'?method=commit&product_id='.$id.'&status=0&version='.$version.'&message='.urlencode($message);
585 585
         $this->getRequestApi($request, $authKey, $url);
586 586
 
587 587
         $app->addError($message, 'admin');
@@ -653,9 +653,9 @@  discard block
 block discarded – undo
653 653
                 'ignore_errors' => false,
654 654
                 'timeout' => 60,
655 655
                 'header' => array(
656
-                    'Authorization: ' . base64_encode($authKey),
657
-                    'x-eccube-store-url: ' . base64_encode($request->getSchemeAndHttpHost() . $request->getBasePath()),
658
-                    'x-eccube-store-version: ' . base64_encode(Constant::VERSION)
656
+                    'Authorization: '.base64_encode($authKey),
657
+                    'x-eccube-store-url: '.base64_encode($request->getSchemeAndHttpHost().$request->getBasePath()),
658
+                    'x-eccube-store-version: '.base64_encode(Constant::VERSION)
659 659
                 )
660 660
             )
661 661
         );
@@ -680,10 +680,10 @@  discard block
 block discarded – undo
680 680
 
681 681
             switch ($statusCode) {
682 682
                 case '404':
683
-                    $message = $statusCode . ' : ' . $message;
683
+                    $message = $statusCode.' : '.$message;
684 684
                     break;
685 685
                 case '500':
686
-                    $message = $statusCode . ' : ' . $message;
686
+                    $message = $statusCode.' : '.$message;
687 687
                     break;
688 688
                 default:
689 689
                     $message = "EC-CUBEオーナーズストアにエラーが発生しています。";
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Store/TemplateController.php 1 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/BlockController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@
 block discarded – undo
38 38
 
39 39
         if ($app['eccube.layout']) {
40 40
             foreach ($app['eccube.layout']->getBlocPositions() as $blocPositions) {
41
-                if ($blocPositions->getTargetId() == constant("Eccube\Entity\BlocPosition::" . $position)) {
41
+                if ($blocPositions->getTargetId() == constant("Eccube\Entity\BlocPosition::".$position)) {
42 42
                     $blocks[] = $blocPositions->getBloc();
43 43
                 }
44 44
             }
Please login to merge, or discard this patch.
src/Eccube/Controller/Mypage/DeliveryController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@
 block discarded – undo
79 79
 
80 80
         // 遷移が正しくない場合、デフォルトであるマイページの配送先追加の画面を設定する
81 81
         if (!in_array($parentPage, $allowdParents)) {
82
-            $parentPage  = $app->url('mypage_delivery');
82
+            $parentPage = $app->url('mypage_delivery');
83 83
         }
84 84
 
85 85
         /* @var $form \Symfony\Component\Form\FormInterface */
Please login to merge, or discard this patch.
src/Eccube/Controller/UserDataController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@
 block discarded – undo
52 52
         $paths[] = $app['config']['user_data_realdir'];
53 53
         $app['twig.loader']->addLoader(new \Twig_Loader_Filesystem($paths));
54 54
 
55
-        $file = $PageLayout->getFileName() . '.twig';
55
+        $file = $PageLayout->getFileName().'.twig';
56 56
 
57 57
         return $app['twig']->render($file);
58 58
     }
Please login to merge, or discard this patch.
src/Eccube/Doctrine/Filter/NoStockHiddenFilter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
     public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias)
33 33
     {
34 34
         if ($targetEntity->reflClass->getName() === 'Eccube\Entity\ProductClass') {
35
-            return $targetTableAlias . '.stock >= 1 OR ' . $targetTableAlias . '.stock_unlimited = 1';
35
+            return $targetTableAlias.'.stock >= 1 OR '.$targetTableAlias.'.stock_unlimited = 1';
36 36
         } else {
37 37
             return "";
38 38
         }
Please login to merge, or discard this patch.