Completed
Pull Request — master (#1999)
by chihiro
69:58
created
src/Eccube/ServiceProvider/LogServiceProvider.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -21,17 +21,17 @@  discard block
 block discarded – undo
21 21
         $app->register(new \Silex\Provider\MonologServiceProvider());
22 22
 
23 23
         // Log
24
-        $app['eccube.logger'] = $app->share(function ($app) {
24
+        $app['eccube.logger'] = $app->share(function($app) {
25 25
             return new Logger($app);
26 26
         });
27 27
 
28 28
         // ヘルパー作成
29
-        $app['eccube.monolog.helper'] = $app->share(function ($app) {
29
+        $app['eccube.monolog.helper'] = $app->share(function($app) {
30 30
             return new LogHelper($app);
31 31
         });
32 32
 
33 33
         // ログクラス作成ファクトリー
34
-        $app['eccube.monolog.factory'] = $app->protect(function (array $channelValues) use ($app) {
34
+        $app['eccube.monolog.factory'] = $app->protect(function(array $channelValues) use ($app) {
35 35
 
36 36
             $log = new $app['monolog.logger.class']($channelValues['name']);
37 37
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
         // monologの設定は除外
47 47
         unset($channels['monolog']);
48 48
         foreach ($channels as $channel => $channelValues) {
49
-            $app['monolog.logger.'.$channel] = $app->share(function ($app) use ($channelValues) {
49
+            $app['monolog.logger.'.$channel] = $app->share(function($app) use ($channelValues) {
50 50
                 return $app['eccube.monolog.factory']($channelValues);
51 51
             });
52 52
         }
@@ -54,15 +54,15 @@  discard block
 block discarded – undo
54 54
         // MonologServiceProviderで定義されているmonolog.handlerの置換
55 55
         $channelValues = $app['config']['log']['channel']['monolog'];
56 56
         $app['monolog.name'] = $channelValues['name'];
57
-        $app['monolog.handler'] = $app->share(function ($app) use ($channelValues) {
57
+        $app['monolog.handler'] = $app->share(function($app) use ($channelValues) {
58 58
             return $app['eccube.monolog.helper']->getHandler($channelValues);
59 59
         });
60 60
 
61
-        $app['eccube.monolog.listener'] = $app->share(function () use ($app) {
61
+        $app['eccube.monolog.listener'] = $app->share(function() use ($app) {
62 62
             return new LogListener($app['eccube.logger']);
63 63
         });
64 64
 
65
-        $app['listener.requestdump'] = $app->share(function ($app) {
65
+        $app['listener.requestdump'] = $app->share(function($app) {
66 66
             return new \Eccube\EventListener\RequestDumpListener($app);
67 67
         });
68 68
     }
Please login to merge, or discard this patch.
src/Eccube/Command/PluginCommand.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,6 @@
 block discarded – undo
27 27
 use Symfony\Component\Form\AbstractType;
28 28
 use Symfony\Component\Form\Extension\Core\Type;
29 29
 use Symfony\Component\Form\FormBuilderInterface;
30
-use Symfony\Component\Validator\Constraints as Assert;
31 30
 
32 31
 class SearchProductType extends AbstractType
33 32
 {
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
             if ($code) {
138 138
                 $pluginDir = $service->calcPluginDir($code);
139 139
                 $service->checkPluginArchiveContent($pluginDir);
140
-                $config = $service->readYml($pluginDir . '/config.yml');
141
-                $event = $service->readYml($pluginDir . '/event.yml');
140
+                $config = $service->readYml($pluginDir.'/config.yml');
141
+                $event = $service->readYml($pluginDir.'/event.yml');
142 142
                 $service->checkSamePlugin($config['code']);
143 143
                 $service->registerPlugin($config, $event);
144 144
 
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
             // ディレクトリは残し, プラグインを削除.
189 189
             $pluginDir = $service->calcPluginDir($code);
190
-            $config = $service->readYml($pluginDir . '/config.yml');
190
+            $config = $service->readYml($pluginDir.'/config.yml');
191 191
             $service->callPluginManagerMethod($config, 'disable');
192 192
             $service->callPluginManagerMethod($config, 'uninstall');
193 193
             $service->unregisterPlugin($plugin);
Please login to merge, or discard this patch.
src/Eccube/Doctrine/ORM/Tools/Pagination/LimitSubqueryWalker.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,6 @@
 block discarded – undo
20 20
 
21 21
 use Doctrine\DBAL\Types\Type;
22 22
 use Doctrine\ORM\Mapping\ClassMetadataInfo;
23
-use Doctrine\ORM\ORMException;
24 23
 use Doctrine\ORM\Query;
25 24
 use Doctrine\ORM\Query\TreeWalkerAdapter;
26 25
 use Doctrine\ORM\Query\AST\Functions\IdentityFunction;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
         );
94 94
 
95 95
         $pathExpression = new PathExpression(
96
-            PathExpression::TYPE_STATE_FIELD | PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION,
96
+            PathExpression::TYPE_STATE_FIELD|PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION,
97 97
             $rootAlias,
98 98
             $identifier
99 99
         );
@@ -104,13 +104,13 @@  discard block
 block discarded – undo
104 104
 
105 105
         if (isset($AST->orderByClause)) {
106 106
             foreach ($AST->orderByClause->orderByItems as $item) {
107
-                if ( ! $item->expression instanceof PathExpression) {
107
+                if (!$item->expression instanceof PathExpression) {
108 108
                     continue;
109 109
                 }
110 110
                 
111 111
                 $AST->selectClause->selectExpressions[] = new SelectExpression(
112 112
                     $this->createSelectExpressionItem($item->expression),
113
-                    '_dctrn_ord' . $this->_aliasCounter++
113
+                    '_dctrn_ord'.$this->_aliasCounter++
114 114
                 );
115 115
             }
116 116
         }
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
                     && isset($queryComponents[$expression->identificationVariable])) {
146 146
                     $queryComponent = $queryComponents[$expression->identificationVariable];
147 147
                     if (isset($queryComponent['parent'])
148
-                        && $queryComponent['relation']['type'] & ClassMetadataInfo::TO_MANY) {
148
+                        && $queryComponent['relation']['type']&ClassMetadataInfo::TO_MANY) {
149 149
                         throw new \RuntimeException("Cannot select distinct identifiers from query with LIMIT and ORDER BY on a column from a fetch joined to-many association. Use output walkers.");
150 150
                     }
151 151
                 }
Please login to merge, or discard this patch.
src/Eccube/Doctrine/ORM/Tools/Pagination/Paginator.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
     /**
58 58
      * Constructor.
59 59
      *
60
-     * @param Query|QueryBuilder $query               A Doctrine ORM query or query builder.
60
+     * @param Query $query               A Doctrine ORM query or query builder.
61 61
      * @param boolean            $fetchJoinCollection Whether the query joins a collection (true by default).
62 62
      */
63 63
     public function __construct($query, $fetchJoinCollection = true)
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         if ($this->count === null) {
122 122
             try {
123 123
                 $this->count = array_sum(array_map('current', $this->getCountQuery()->getScalarResult()));
124
-            } catch(NoResultException $e) {
124
+            } catch (NoResultException $e) {
125 125
                 $this->count = 0;
126 126
             }
127 127
         }
@@ -241,7 +241,7 @@  discard block
 block discarded – undo
241 241
         /* @var $countQuery Query */
242 242
         $countQuery = $this->cloneQuery($this->query);
243 243
 
244
-        if ( ! $countQuery->hasHint(CountWalker::HINT_DISTINCT)) {
244
+        if (!$countQuery->hasHint(CountWalker::HINT_DISTINCT)) {
245 245
             $countQuery->setHint(CountWalker::HINT_DISTINCT, true);
246 246
         }
247 247
 
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
         foreach ($parameters as $key => $parameter) {
268 268
             $parameterName = $parameter->getName();
269 269
 
270
-            if( ! (isset($parameterMappings[$parameterName]) || array_key_exists($parameterName, $parameterMappings))) {
270
+            if (!(isset($parameterMappings[$parameterName]) || array_key_exists($parameterName, $parameterMappings))) {
271 271
                 unset($parameters[$key]);
272 272
             }
273 273
         }
Please login to merge, or discard this patch.
src/Eccube/Doctrine/ORM/Tools/Pagination/WhereInWalker.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             $pathType = PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION;
90 90
         }
91 91
 
92
-        $pathExpression       = new PathExpression(PathExpression::TYPE_STATE_FIELD | PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, $rootAlias, $identifierFieldName);
92
+        $pathExpression       = new PathExpression(PathExpression::TYPE_STATE_FIELD|PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, $rootAlias, $identifierFieldName);
93 93
         $pathExpression->type = $pathType;
94 94
 
95 95
         $count = $this->_getQuery()->getHint(self::HINT_PAGINATOR_ID_COUNT);
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
                 array($pathExpression)
101 101
             );
102 102
             $expression = new InExpression($arithmeticExpression);
103
-            $expression->literals[] = new InputParameter(":" . self::PAGINATOR_ID_ALIAS);
103
+            $expression->literals[] = new InputParameter(":".self::PAGINATOR_ID_ALIAS);
104 104
 
105 105
         } else {
106 106
             $expression = new NullComparisonExpression($pathExpression);
Please login to merge, or discard this patch.
src/Eccube/Doctrine/ORM/Tools/Pagination/CountWalker.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
         }
70 70
 
71 71
         $pathExpression = new PathExpression(
72
-            PathExpression::TYPE_STATE_FIELD | PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, $rootAlias,
72
+            PathExpression::TYPE_STATE_FIELD|PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, $rootAlias,
73 73
             $identifierFieldName
74 74
         );
75 75
         $pathExpression->type = $pathType;
Please login to merge, or discard this patch.
src/Eccube/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php 2 patches
Unused Use Statements   -9 removed lines patch added patch discarded remove patch
@@ -18,18 +18,9 @@
 block discarded – undo
18 18
 use Doctrine\DBAL\Platforms\PostgreSqlPlatform;
19 19
 use Doctrine\DBAL\Platforms\SQLAnywherePlatform;
20 20
 use Doctrine\DBAL\Platforms\SQLServerPlatform;
21
-use Doctrine\ORM\Query\AST\ArithmeticExpression;
22
-use Doctrine\ORM\Query\AST\ArithmeticFactor;
23
-use Doctrine\ORM\Query\AST\ArithmeticTerm;
24
-use Doctrine\ORM\Query\AST\Literal;
25 21
 use Doctrine\ORM\Query\AST\OrderByClause;
26
-use Doctrine\ORM\Query\AST\OrderByItem;
27 22
 use Doctrine\ORM\Query\AST\PartialObjectExpression;
28
-use Doctrine\ORM\Query\AST\PathExpression;
29 23
 use Doctrine\ORM\Query\AST\SelectExpression;
30
-use Doctrine\ORM\Query\AST\SimpleArithmeticExpression;
31
-use Doctrine\ORM\Query\Expr\OrderBy;
32
-use Doctrine\ORM\Query\Expr\Select;
33 24
 use Doctrine\ORM\Query\SqlWalker;
34 25
 use Doctrine\ORM\Query\AST\SelectStatement;
35 26
 
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -209,8 +209,8 @@  discard block
 block discarded – undo
209 209
         $sqlIdentifier = $this->getSQLIdentifier($AST);
210 210
 
211 211
         if ($hasOrderBy) {
212
-            $orderGroupBy = ' GROUP BY ' . implode(', ', $sqlIdentifier);
213
-            $sqlIdentifier[] = 'MIN(' . $this->walkResultVariable('dctrn_rownum') . ') AS dctrn_minrownum';
212
+            $orderGroupBy = ' GROUP BY '.implode(', ', $sqlIdentifier);
213
+            $sqlIdentifier[] = 'MIN('.$this->walkResultVariable('dctrn_rownum').') AS dctrn_minrownum';
214 214
         }
215 215
 
216 216
         // Build the counter query
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
         );
222 222
 
223 223
         if ($hasOrderBy) {
224
-            $sql .= $orderGroupBy . $outerOrderBy;
224
+            $sql .= $orderGroupBy.$outerOrderBy;
225 225
         }
226 226
 
227 227
         // Apply the limit and offset.
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
     {
369 369
         // If the sql statement has an order by clause, we need to wrap it in a new select distinct
370 370
         // statement
371
-        if (! $orderByClause instanceof OrderByClause) {
371
+        if (!$orderByClause instanceof OrderByClause) {
372 372
             return $sql;
373 373
         }
374 374
 
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
             = array();
405 405
 
406 406
         // Generate DQL alias -> SQL table alias mapping
407
-        foreach(array_keys($this->rsm->aliasMap) as $dqlAlias) {
407
+        foreach (array_keys($this->rsm->aliasMap) as $dqlAlias) {
408 408
             $dqlAliasToClassMap[$dqlAlias] = $class = $this->queryComponents[$dqlAlias]['metadata'];
409 409
             $dqlAliasToSqlTableAliasMap[$dqlAlias] = $this->getSQLTableAlias($class->getTableName(), $dqlAlias);
410 410
         }
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
         $fieldSearchPattern = '/(?<![a-z0-9_])%s\.%s(?![a-z0-9_])/i';
414 414
 
415 415
         // Generate search patterns for each field's path expression in the order by clause
416
-        foreach($this->rsm->fieldMappings as $fieldAlias => $fieldName) {
416
+        foreach ($this->rsm->fieldMappings as $fieldAlias => $fieldName) {
417 417
             $dqlAliasForFieldAlias = $this->rsm->columnOwnerMap[$fieldAlias];
418 418
             $class = $dqlAliasToClassMap[$dqlAliasForFieldAlias];
419 419
 
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
             $replacements[] = $fieldAlias;
450 450
         }
451 451
 
452
-        foreach($orderByClause->orderByItems as $orderByItem) {
452
+        foreach ($orderByClause->orderByItems as $orderByItem) {
453 453
             // Walk order by item to get string representation of it
454 454
             $orderByItemString = $this->walkOrderByItem($orderByItem);
455 455
 
Please login to merge, or discard this patch.
src/Eccube/Doctrine/ORM/Tools/Pagination/RowNumberOverFunction.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,9 +44,9 @@
 block discarded – undo
44 44
      */
45 45
     public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker)
46 46
     {
47
-        return 'ROW_NUMBER() OVER(' . trim($sqlWalker->walkOrderByClause(
47
+        return 'ROW_NUMBER() OVER('.trim($sqlWalker->walkOrderByClause(
48 48
             $this->orderByClause
49
-        )) . ')';
49
+        )).')';
50 50
     }
51 51
 
52 52
     /**
Please login to merge, or discard this patch.
src/Eccube/Command/ConfigCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -91,7 +91,7 @@
 block discarded – undo
91 91
             }
92 92
         }
93 93
 
94
-        $recursive = function ($config, $space = '    ') use (&$recursive, $output) {
94
+        $recursive = function($config, $space = '    ') use (&$recursive, $output) {
95 95
             foreach ($config as $key => $item) {
96 96
                 if (is_array($item)) {
97 97
                     $space = '    ';
Please login to merge, or discard this patch.