Completed
Pull Request — master (#2152)
by NOBU
82:06 queued 38:49
created
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   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
                 $config['template_realdir'] = $config['root_dir'].'/app/template/'.$templateCode;
78 78
                 $config['template_html_realdir'] = $config['public_path_realdir'].'/template/'.$templateCode;
79 79
                 $config['front_urlpath'] = $config['root_urlpath'].RELATIVE_PUBLIC_DIR_PATH.'/template/'.$templateCode;
80
-                $config['block_realdir'] =$config['template_realdir'].'/Block';
80
+                $config['block_realdir'] = $config['template_realdir'].'/Block';
81 81
 
82 82
                 if (file_exists($file.'.php')) {
83 83
                     file_put_contents($file.'.php', sprintf('<?php return %s', var_export($config, true)).';');
@@ -117,19 +117,19 @@  discard block
 block discarded – undo
117 117
         // 該当テンプレートのディレクトリ
118 118
         $config = $app['config'];
119 119
         $templateCode = $Template->getCode();
120
-        $targetRealDir = $config['root_dir'] . '/app/template/' . $templateCode;
121
-        $targetHtmlRealDir = $config['root_dir'] . '/html/template/' . $templateCode;
120
+        $targetRealDir = $config['root_dir'].'/app/template/'.$templateCode;
121
+        $targetHtmlRealDir = $config['root_dir'].'/html/template/'.$templateCode;
122 122
 
123 123
         // 一時ディレクトリ
124 124
         $uniqId = sha1(Str::random(32));
125
-        $tmpDir = $config['template_temp_realdir'] . '/' . $uniqId;
126
-        $appDir = $tmpDir . '/app';
127
-        $htmlDir = $tmpDir . '/html';
125
+        $tmpDir = $config['template_temp_realdir'].'/'.$uniqId;
126
+        $appDir = $tmpDir.'/app';
127
+        $htmlDir = $tmpDir.'/html';
128 128
 
129 129
         // ファイル名
130
-        $tarFile = $config['template_temp_realdir'] . '/' . $uniqId . '.tar';
131
-        $tarGzFile = $tarFile . '.gz';
132
-        $downloadFileName = $Template->getCode() . '.tar.gz';
130
+        $tarFile = $config['template_temp_realdir'].'/'.$uniqId.'.tar';
131
+        $tarGzFile = $tarFile.'.gz';
132
+        $downloadFileName = $Template->getCode().'.tar.gz';
133 133
 
134 134
         // 該当テンプレートを一時ディレクトリへコピーする.
135 135
         $fs = new Filesystem();
@@ -149,14 +149,14 @@  discard block
 block discarded – undo
149 149
 
150 150
         // ダウンロード完了後にファイルを削除する.
151 151
         // http://stackoverflow.com/questions/15238897/removing-file-after-delivering-response-with-silex-symfony
152
-        $app->finish(function (Request $request, Response $response, \Silex\Application $app) use (
152
+        $app->finish(function(Request $request, Response $response, \Silex\Application $app) use (
153 153
             $tmpDir,
154 154
             $tarFile,
155 155
             $tarGzFile
156 156
         ) {
157
-            $app['monolog']->addDebug('remove temp file: ' . $tmpDir);
158
-            $app['monolog']->addDebug('remove temp file: ' . $tarFile);
159
-            $app['monolog']->addDebug('remove temp file: ' . $tarGzFile);
157
+            $app['monolog']->addDebug('remove temp file: '.$tmpDir);
158
+            $app['monolog']->addDebug('remove temp file: '.$tarFile);
159
+            $app['monolog']->addDebug('remove temp file: '.$tarGzFile);
160 160
             $fs = new Filesystem();
161 161
             $fs->remove($tmpDir);
162 162
             $fs->remove($tarFile);
@@ -197,8 +197,8 @@  discard block
 block discarded – undo
197 197
         // テンプレートディレクトリの削除
198 198
         $config = $app['config'];
199 199
         $templateCode = $Template->getCode();
200
-        $targetRealDir = $config['root_dir'] . '/app/template/' . $templateCode;
201
-        $targetHtmlRealDir = $config['root_dir'] . '/html/template/' . $templateCode;
200
+        $targetRealDir = $config['root_dir'].'/app/template/'.$templateCode;
201
+        $targetHtmlRealDir = $config['root_dir'].'/html/template/'.$templateCode;
202 202
 
203 203
         $fs = new Filesystem();
204 204
         $fs->remove($targetRealDir);
@@ -241,18 +241,18 @@  discard block
 block discarded – undo
241 241
                 // 該当テンプレートのディレクトリ
242 242
                 $config = $app['config'];
243 243
                 $templateCode = $Template->getCode();
244
-                $targetRealDir = $config['root_dir'] . '/app/template/' . $templateCode;
245
-                $targetHtmlRealDir = $config['root_dir'] . '/html/template/' . $templateCode;
244
+                $targetRealDir = $config['root_dir'].'/app/template/'.$templateCode;
245
+                $targetHtmlRealDir = $config['root_dir'].'/html/template/'.$templateCode;
246 246
 
247 247
                 // 一時ディレクトリ
248 248
                 $uniqId = sha1(Str::random(32));
249
-                $tmpDir = $config['template_temp_realdir'] . '/' . $uniqId;
250
-                $appDir = $tmpDir . '/app';
251
-                $htmlDir = $tmpDir . '/html';
249
+                $tmpDir = $config['template_temp_realdir'].'/'.$uniqId;
250
+                $appDir = $tmpDir.'/app';
251
+                $htmlDir = $tmpDir.'/html';
252 252
 
253 253
                 $formFile = $form['file']->getData();
254 254
                 // ファイル名
255
-                $archive = $templateCode . '.' . $formFile->getClientOriginalExtension();
255
+                $archive = $templateCode.'.'.$formFile->getClientOriginalExtension();
256 256
 
257 257
                 // ファイルを一時ディレクトリへ移動.
258 258
                 $formFile->move($tmpDir, $archive);
@@ -261,11 +261,11 @@  discard block
 block discarded – undo
261 261
                 try {
262 262
                     if ($formFile->getClientOriginalExtension() == 'zip') {
263 263
                         $zip = new \ZipArchive();
264
-                        $zip->open($tmpDir . '/' . $archive);
264
+                        $zip->open($tmpDir.'/'.$archive);
265 265
                         $zip->extractTo($tmpDir);
266 266
                         $zip->close();
267 267
                     } else {
268
-                        $phar = new \PharData($tmpDir . '/' . $archive);
268
+                        $phar = new \PharData($tmpDir.'/'.$archive);
269 269
                         $phar->extractTo($tmpDir, null, true);
270 270
                     }
271 271
                 } catch (\Exception $e) {
Please login to merge, or discard this patch.
src/Eccube/Service/CsvImportService.php 2 patches
Unused Use Statements   -2 removed lines patch added patch discarded remove patch
@@ -23,8 +23,6 @@
 block discarded – undo
23 23
 
24 24
 namespace Eccube\Service;
25 25
 
26
-use Eccube\Application;
27
-
28 26
 
29 27
 /**
30 28
  * Copyright (C) 2012-2014 David de Boer <[email protected]>
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -117,9 +117,9 @@  discard block
 block discarded – undo
117 117
 
118 118
         $this->file = $file;
119 119
         $this->file->setFlags(
120
-            \SplFileObject::READ_CSV |
121
-            \SplFileObject::SKIP_EMPTY |
122
-            \SplFileObject::READ_AHEAD |
120
+            \SplFileObject::READ_CSV|
121
+            \SplFileObject::SKIP_EMPTY|
122
+            \SplFileObject::READ_AHEAD|
123 123
             \SplFileObject::DROP_NEW_LINE
124 124
         );
125 125
         $this->file->setCsvControl(
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
             if ($count > 1) {
363 363
                 $incrementedHeaders[] = $header;
364 364
                 for ($i = 1; $i < $count; $i++) {
365
-                    $incrementedHeaders[] = $header . $i;
365
+                    $incrementedHeaders[] = $header.$i;
366 366
                 }
367 367
             } else {
368 368
                 $incrementedHeaders[] = $header;
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
     protected function convertEncodingRows($row) {
414 414
         if ('\\' === DIRECTORY_SEPARATOR && PHP_VERSION_ID >= 70000) {
415 415
             foreach ($row as &$col) {
416
-                $col = mb_convert_encoding($col , 'UTF-8', 'SJIS-win');
416
+                $col = mb_convert_encoding($col, 'UTF-8', 'SJIS-win');
417 417
             }
418 418
         }
419 419
         return $row;
Please login to merge, or discard this patch.
html/index_dev.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@
 block discarded – undo
58 58
 
59 59
 // load config dev
60 60
 $conf = $app['config'];
61
-$app['config'] = $app->share(function () use ($conf) {
61
+$app['config'] = $app->share(function() use ($conf) {
62 62
     $confarray = array();
63 63
     $config_dev_file = __DIR__.'/../app/config/eccube/config_dev.yml';
64 64
     if (file_exists($config_dev_file)) {
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Content/LayoutController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -89,20 +89,20 @@  discard block
 block discarded – undo
89 89
                 $max = count($Blocks);
90 90
                 for ($i = 0; $i < $max; $i++) {
91 91
                     // block_id が取得できない場合は INSERT しない
92
-                    if (!isset($data['id_' . $i])) {
92
+                    if (!isset($data['id_'.$i])) {
93 93
                         continue;
94 94
                     }
95 95
                     // 未使用は INSERT しない
96
-                    if ($data['target_id_' . $i] == \Eccube\Entity\PageLayout::TARGET_ID_UNUSED) {
96
+                    if ($data['target_id_'.$i] == \Eccube\Entity\PageLayout::TARGET_ID_UNUSED) {
97 97
                         continue;
98 98
                     }
99 99
                     // 他のページに anywhere が存在する場合は INSERT しない
100
-                    $anywhere = (isset($data['anywhere_' . $i]) && $data['anywhere_' . $i] == 1) ? 1 : 0;
101
-                    if (isset($data['anywhere_' . $i]) && $data['anywhere_' . $i] == 1) {
100
+                    $anywhere = (isset($data['anywhere_'.$i]) && $data['anywhere_'.$i] == 1) ? 1 : 0;
101
+                    if (isset($data['anywhere_'.$i]) && $data['anywhere_'.$i] == 1) {
102 102
                         $Other = $app['orm.em']->getRepository('Eccube\Entity\BlockPosition')
103 103
                             ->findBy(array(
104 104
                                 'anywhere' => 1,
105
-                                'block_id' => $data['id_' . $i],
105
+                                'block_id' => $data['id_'.$i],
106 106
                             ));
107 107
                         if (count($Other) > 0) {
108 108
                             continue;
@@ -112,14 +112,14 @@  discard block
 block discarded – undo
112 112
                     $BlockPosition = new \Eccube\Entity\BlockPosition();
113 113
                     $Block = $app['orm.em']->getRepository('Eccube\Entity\Block')
114 114
                         ->findOneBy(array(
115
-                            'id' => $data['id_' . $i],
115
+                            'id' => $data['id_'.$i],
116 116
                             'DeviceType' => $DeviceType,
117 117
                         ));
118 118
                     $BlockPosition
119 119
                         ->setPageId($id)
120
-                        ->setBlockId($data['id_' . $i])
121
-                        ->setBlockRow($data['top_' . $i])
122
-                        ->setTargetId($data['target_id_' . $i])
120
+                        ->setBlockId($data['id_'.$i])
121
+                        ->setBlockRow($data['top_'.$i])
122
+                        ->setTargetId($data['target_id_'.$i])
123 123
                         ->setBlock($Block)
124 124
                         ->setPageLayout($TargetPageLayout)
125 125
                         ->setAnywhere($anywhere);
Please login to merge, or discard this patch.
src/Eccube/Controller/Admin/Product/ClassCategoryController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@
 block discarded – undo
95 95
         $num = $app['eccube.repository.product_class']->createQueryBuilder('pc')
96 96
             ->select('count(pc.id)')
97 97
             ->where('pc.ClassCategory1 = :id OR pc.ClassCategory2 = :id')
98
-            ->setParameter('id',$id)
98
+            ->setParameter('id', $id)
99 99
             ->getQuery()
100 100
             ->getSingleScalarResult();
101 101
         if ($num > 0) {
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/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/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.
src/Eccube/Doctrine/Filter/OrderStatusFilter.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -33,12 +33,12 @@
 block discarded – undo
33 33
     {
34 34
         // 決済処理中/購入処理中を除く.
35 35
         if ($targetEntity->reflClass->getName() === 'Eccube\Entity\Order') {
36
-            return $targetTableAlias . '.status <> 7 AND ' . $targetTableAlias . '.status <> 8';
36
+            return $targetTableAlias.'.status <> 7 AND '.$targetTableAlias.'.status <> 8';
37 37
         }
38 38
 
39 39
         // 決済処理中/購入処理中を除く.
40 40
         if ($targetEntity->reflClass->getName() === 'Eccube\Entity\Master\OrderStatus') {
41
-            return $targetTableAlias . '.id <> 7 AND ' . $targetTableAlias . '.id <> 8';
41
+            return $targetTableAlias.'.id <> 7 AND '.$targetTableAlias.'.id <> 8';
42 42
         }
43 43
 
44 44
         return '';
Please login to merge, or discard this patch.