Failed Conditions
Pull Request — experimental/3.1 (#2672)
by
unknown
16:13
created
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/LimitSubqueryWalker.php 2 patches
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.
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\AST\Functions\IdentityFunction;
26 25
 use Doctrine\ORM\Query\AST\PathExpression;
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/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php 2 patches
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.
Unused Use Statements   -9 removed lines patch added patch discarded remove patch
@@ -18,19 +18,10 @@
 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 24
 use Doctrine\ORM\Query\AST\SelectStatement;
31
-use Doctrine\ORM\Query\AST\SimpleArithmeticExpression;
32
-use Doctrine\ORM\Query\Expr\OrderBy;
33
-use Doctrine\ORM\Query\Expr\Select;
34 25
 use Doctrine\ORM\Query\SqlWalker;
35 26
 
36 27
 /**
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.
src/Eccube/Controller/Admin/Product/ProductController.php 2 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -792,6 +792,7 @@
 block discarded – undo
792 792
      * ProductCategory作成
793 793
      * @param \Eccube\Entity\Product $Product
794 794
      * @param \Eccube\Entity\Category $Category
795
+     * @param integer $count
795 796
      * @return \Eccube\Entity\ProductCategory
796 797
      */
797 798
     private function createProductCategory($Product, $Category, $count)
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
                     }
319 319
 
320 320
                     $extension = $image->getClientOriginalExtension();
321
-                    $filename = date('mdHis') . uniqid('_') . '.' . $extension;
321
+                    $filename = date('mdHis').uniqid('_').'.'.$extension;
322 322
                     $image->move($this->appConfig['image_temp_realdir'], $filename);
323 323
                     $files[] = $filename;
324 324
                 }
@@ -479,8 +479,8 @@  discard block
 block discarded – undo
479 479
                 $Categories = $form->get('Category')->getData();
480 480
                 $categoriesIdList = array();
481 481
                 foreach ($Categories as $Category) {
482
-                    foreach($Category->getPath() as $ParentCategory){
483
-                        if (!isset($categoriesIdList[$ParentCategory->getId()])){
482
+                    foreach ($Category->getPath() as $ParentCategory) {
483
+                        if (!isset($categoriesIdList[$ParentCategory->getId()])) {
484 484
                             $ProductCategory = $this->createProductCategory($Product, $ParentCategory, $count);
485 485
                             $this->entityManager->persist($ProductCategory);
486 486
                             $count++;
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
                             $categoriesIdList[$ParentCategory->getId()] = true;
490 490
                         }
491 491
                     }
492
-                    if (!isset($categoriesIdList[$Category->getId()])){
492
+                    if (!isset($categoriesIdList[$Category->getId()])) {
493 493
                         $ProductCategory = $this->createProductCategory($Product, $Category, $count);
494 494
                         $this->entityManager->persist($ProductCategory);
495 495
                         $count++;
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
                     $this->entityManager->persist($ProductImage);
512 512
 
513 513
                     // 移動
514
-                    $file = new File($this->appConfig['image_temp_realdir'] . '/' . $add_image);
514
+                    $file = new File($this->appConfig['image_temp_realdir'].'/'.$add_image);
515 515
                     $file->move($this->appConfig['image_save_realdir']);
516 516
                 }
517 517
 
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
 
532 532
                     // 削除
533 533
                     $fs = new Filesystem();
534
-                    $fs->remove($this->appConfig['image_save_realdir'] . '/' . $delete_image);
534
+                    $fs->remove($this->appConfig['image_save_realdir'].'/'.$delete_image);
535 535
                 }
536 536
                 $this->entityManager->persist($Product);
537 537
                 $this->entityManager->flush();
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
                     foreach ($deleteImages as $deleteImage) {
667 667
                         try {
668 668
                             $fs = new Filesystem();
669
-                            $fs->remove($this->appConfig['image_save_realdir'] . '/' . $deleteImage);
669
+                            $fs->remove($this->appConfig['image_save_realdir'].'/'.$deleteImage);
670 670
                         } catch (\Exception $e) {
671 671
                             // エラーが発生しても無視する
672 672
                         }
@@ -741,10 +741,10 @@  discard block
 block discarded – undo
741 741
 
742 742
                     // 画像ファイルを新規作成
743 743
                     $extension = pathinfo($Image->getFileName(), PATHINFO_EXTENSION);
744
-                    $filename = date('mdHis') . uniqid('_') . '.' . $extension;
744
+                    $filename = date('mdHis').uniqid('_').'.'.$extension;
745 745
                     try {
746 746
                         $fs = new Filesystem();
747
-                        $fs->copy($this->appConfig['image_save_realdir'] . '/' . $Image->getFileName(), $this->appConfig['image_save_realdir'] . '/' . $filename);
747
+                        $fs->copy($this->appConfig['image_save_realdir'].'/'.$Image->getFileName(), $this->appConfig['image_save_realdir'].'/'.$filename);
748 748
                     } catch (\Exception $e) {
749 749
                         // エラーが発生しても無視する
750 750
                     }
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
         $em->getConfiguration()->setSQLLogger(null);
825 825
 
826 826
         $response = new StreamedResponse();
827
-        $response->setCallback(function () use ($app, $request) {
827
+        $response->setCallback(function() use ($app, $request) {
828 828
 
829 829
             // CSV種別を元に初期化.
830 830
             $this->csvExportService->initCsvType(CsvType::CSV_TYPE_PRODUCT);
@@ -864,7 +864,7 @@  discard block
 block discarded – undo
864 864
             // データ行の出力.
865 865
             $this->csvExportService->setExportQueryBuilder($qb);
866 866
 
867
-            $this->csvExportService->exportData(function ($entity, CsvExportService $csvService) use ($app, $request) {
867
+            $this->csvExportService->exportData(function($entity, CsvExportService $csvService) use ($app, $request) {
868 868
                 $Csvs = $csvService->getCsvs();
869 869
 
870 870
                 /** @var $Product \Eccube\Entity\Product */
@@ -907,9 +907,9 @@  discard block
 block discarded – undo
907 907
         });
908 908
 
909 909
         $now = new \DateTime();
910
-        $filename = 'product_' . $now->format('YmdHis') . '.csv';
910
+        $filename = 'product_'.$now->format('YmdHis').'.csv';
911 911
         $response->headers->set('Content-Type', 'application/octet-stream');
912
-        $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename);
912
+        $response->headers->set('Content-Disposition', 'attachment; filename='.$filename);
913 913
         $response->send();
914 914
 
915 915
         log_info('商品CSV出力ファイル名', array($filename));
Please login to merge, or discard this patch.
src/Eccube/InstallApplication.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
 
40 40
         if (is_writable($logDir)) {
41 41
             if (file_exists($installLog) && !is_writable($installLog)) {
42
-                die($installLog . ' の書込権限を変更して下さい。');
42
+                die($installLog.' の書込権限を変更して下さい。');
43 43
             }
44 44
             // install step2 でログディレクトリに書き込み権限が付与されればログ出力を開始する.
45 45
             $app->register(new \Silex\Provider\MonologServiceProvider(), array(
Please login to merge, or discard this patch.
src/Eccube/Command/GeneratorCommand/EntityFromDbGenerator.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@
 block discarded – undo
164 164
             $cmf->setEntityManager($em);
165 165
             $metadatas = $cmf->getAllMetadata();
166 166
 
167
-            $filters = array_map(function ($value) {
167
+            $filters = array_map(function($value) {
168 168
                 return ucfirst(Inflector::camelize(str_replace('plg_', '', $value)));
169 169
             }, $tableList);
170 170
             $metadatas = MetadataFilter::filter($metadatas, $filters);
Please login to merge, or discard this patch.
src/Eccube/Application.php 3 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -964,7 +964,7 @@
 block discarded – undo
964 964
      * 失敗 : \Doctrine\DBAL\DBALExceptionエラーが発生( 接続に失敗した場合 )、エラー画面を表示しdie()
965 965
      * 備考 : app['debug']がtrueの際は処理を行わない
966 966
      *
967
-     * @return boolean true
967
+     * @return null|boolean true
968 968
      *
969 969
      */
970 970
     protected function checkDatabaseConnection()
Please login to merge, or discard this patch.
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -660,13 +660,13 @@
 block discarded – undo
660 660
         $pluginConfigs = PluginConfigManager::getPluginConfigAll($this['debug']);
661 661
         $ormMappings = array();
662 662
         $ormMappings[] = array(
663
-             'type' => 'annotation',
664
-             'namespace' => 'Eccube\Entity',
665
-             'path' => array(
666
-                 __DIR__.'/Entity'
667
-             ),
668
-             'use_simple_annotation_reader' => false,
669
-         );
663
+                'type' => 'annotation',
664
+                'namespace' => 'Eccube\Entity',
665
+                'path' => array(
666
+                    __DIR__.'/Entity'
667
+                ),
668
+                'use_simple_annotation_reader' => false,
669
+            );
670 670
 
671 671
         if (isset($this['config']['vendor_dir']) && file_exists($this['config']['vendor_dir'].'/Entity')) {
672 672
 
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
         $this->register(new MobileDetectServiceProvider());
235 235
         $this->register(new TwigLintServiceProvider());
236 236
 
237
-        $this->error(function (\Exception $e, Request $request, $code) {
237
+        $this->error(function(\Exception $e, Request $request, $code) {
238 238
             if ($this['debug']) {
239 239
                 return;
240 240
             }
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
 
300 300
         $pluginSubDirs = (function($dirName) use ($enabledPluginDirs) {
301 301
             return array_map(function($pluginDir) use ($dirName) {
302
-                return $pluginDir . '/' . $dirName;
302
+                return $pluginDir.'/'.$dirName;
303 303
             }, $enabledPluginDirs);
304 304
         });
305 305
 
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
             return $router;
376 376
         });
377 377
 
378
-        $this['eccube.router.origin'] = function ($app) {
378
+        $this['eccube.router.origin'] = function($app) {
379 379
             $resource = __DIR__.'/Controller';
380 380
             $cachePrefix = 'Origin';
381 381
 
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
         $this['eccube.routers.plugin'] = [];
386 386
 
387 387
         if (isset($this['config']['vendor_dir']) && file_exists($this['config']['vendor_dir'].'/Controller')) {
388
-            $this['eccube.router.extend'] = function ($app) {
388
+            $this['eccube.router.extend'] = function($app) {
389 389
                 $resource = $app['config']['vendor_dir'].'/Controller';
390 390
                 $cachePrefix = 'Extend';
391 391
 
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
                 return $router;
395 395
             };
396 396
         }
397
-        $this->extend('request_matcher', function ($matcher, $app) {
397
+        $this->extend('request_matcher', function($matcher, $app) {
398 398
             $matchers = [];
399 399
             if (isset($app['eccube.router.extend'])) {
400 400
                 $matchers[] = $app['eccube.router.extend'];
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
             return new ChainUrlMatcher($matchers, $app['request_context']);
409 409
         });
410 410
 
411
-        $this->extend('url_generator', function ($generator, $app) {
411
+        $this->extend('url_generator', function($generator, $app) {
412 412
             $generators = [];
413 413
             if (isset($app['eccube.router.extend'])) {
414 414
                 $generators[] = $app['eccube.router.extend'];
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
         });
424 424
 
425 425
         // Route CollectionにEC-CUBEで定義したルーティングを追加(debug tool barに出力するため)
426
-        $this->extend('routes', function ($routes, $app) {
426
+        $this->extend('routes', function($routes, $app) {
427 427
             if (isset($app['eccube.router.extend'])) {
428 428
                 $routes->addCollection($app['eccube.router.extend']->getRouteCollection());
429 429
             }
@@ -458,7 +458,7 @@  discard block
 block discarded – undo
458 458
             'translator.cache_dir' => $this['debug'] ? null : $this['config']['root_dir'].'/app/cache/translator',
459 459
             'locale_fallbacks' => [$this['config']['locale'], 'en'],
460 460
         ));
461
-        $this->extend('translator', function ($translator, \Silex\Application $app) {
461
+        $this->extend('translator', function($translator, \Silex\Application $app) {
462 462
             $translator->addLoader('php', new \Symfony\Component\Translation\Loader\PhpFileLoader());
463 463
 
464 464
             $file = __DIR__.'/Resource/locale/messages.'.$app['locale'].'.php';
@@ -501,14 +501,14 @@  discard block
 block discarded – undo
501 501
         $this->register(new \Silex\Provider\TwigServiceProvider(), array(
502 502
             'twig.form.templates' => array('Form/form_div_layout.twig'),
503 503
         ));
504
-        $this->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) {
504
+        $this->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) {
505 505
             $twig->addExtension(new \Eccube\Twig\Extension\EccubeExtension($app));
506 506
             $twig->addExtension(new \Twig_Extension_StringLoader());
507 507
 
508 508
             return $twig;
509 509
         });
510 510
 
511
-        $this->before(function (Request $request, \Silex\Application $app) {
511
+        $this->before(function(Request $request, \Silex\Application $app) {
512 512
             $app['admin'] = $app['front'] = false;
513 513
             $pathinfo = rawurldecode($request->getPathInfo());
514 514
             if (strpos($pathinfo, '/'.trim($app['config']['admin_route'], '/').'/') === 0) {
@@ -524,7 +524,7 @@  discard block
 block discarded – undo
524 524
                 }
525 525
                 $paths[] = $app['config']['template_admin_realdir'];
526 526
                 $paths[] = __DIR__.'/../../app/Plugin';
527
-                $cacheDir =  __DIR__.'/../../app/cache/twig/admin';
527
+                $cacheDir = __DIR__.'/../../app/cache/twig/admin';
528 528
             } else {
529 529
                 // モバイル端末時、smartphoneディレクトリを探索パスに追加する.
530 530
                 if ($app['mobile_detect.device_type'] == \Eccube\Entity\Master\DeviceType::DEVICE_TYPE_SP) {
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
                 }
540 540
                 $paths[] = $app['config']['template_default_realdir'];
541 541
                 $paths[] = __DIR__.'/../../app/Plugin';
542
-                $cacheDir =  __DIR__.'/../../app/cache/twig/'.$app['config']['template_code'];
542
+                $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code'];
543 543
             }
544 544
             $app['twig']->setCache($app['debug'] ? null : $cacheDir);
545 545
             $app['twig.loader']->addLoader(new \Twig_Loader_Filesystem($paths));
@@ -557,7 +557,7 @@  discard block
 block discarded – undo
557 557
         }, self::EARLY_EVENT);
558 558
 
559 559
         // twigのグローバル変数を定義.
560
-        $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) {
560
+        $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) {
561 561
             // 未ログイン時にマイページや管理画面以下にアクセスするとSubRequestで実行されるため,
562 562
             // $event->isMasterRequest()ではなく、グローバル変数が初期化済かどうかの判定を行う
563 563
             if (isset($this['twig_global_initialized']) && $this['twig_global_initialized'] === true) {
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
         // メール送信時の文字エンコード指定(デフォルトはUTF-8)
643 643
         if (isset($this['config']['mail']['charset_iso_2022_jp']) && is_bool($this['config']['mail']['charset_iso_2022_jp'])) {
644 644
             if ($this['config']['mail']['charset_iso_2022_jp'] === true) {
645
-                \Swift::init(function () {
645
+                \Swift::init(function() {
646 646
                     \Swift_DependencyContainer::getInstance()
647 647
                         ->register('mime.qpheaderencoder')
648 648
                         ->asAliasOf('mime.base64headerencoder');
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
         $this->register(new \Saxulum\DoctrineOrmManagerRegistry\Provider\DoctrineOrmManagerRegistryProvider());
678 678
 
679 679
         $app = $this;
680
-        $this->extend('db.event_manager', function ($evm) use ($app) {
680
+        $this->extend('db.event_manager', function($evm) use ($app) {
681 681
             $initSubscriber = new InitSubscriber($app);
682 682
             $evm->addEventSubscriber($initSubscriber);
683 683
 
@@ -794,7 +794,7 @@  discard block
 block discarded – undo
794 794
 
795 795
         $this->extend(
796 796
             'orm.em.config',
797
-            function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) {
797
+            function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) {
798 798
 
799 799
                 /** @var $chain \Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain */
800 800
                 $chain = $config->getMetadataDriverImpl();
@@ -816,7 +816,7 @@  discard block
 block discarded – undo
816 816
             }
817 817
         );
818 818
 
819
-        $this->extend('orm.em', function (\Doctrine\ORM\EntityManager $em, \Silex\Application $app) {
819
+        $this->extend('orm.em', function(\Doctrine\ORM\EntityManager $em, \Silex\Application $app) {
820 820
             // save
821 821
             $saveEventSubscriber = new \Eccube\Doctrine\EventSubscriber\SaveEventSubscriber($app);
822 822
             $em->getEventManager()->addEventSubscriber($saveEventSubscriber);
@@ -841,7 +841,7 @@  discard block
 block discarded – undo
841 841
             // second level cacheの設定.
842 842
             $this->extend(
843 843
                 'orm.em.config',
844
-                function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) {
844
+                function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) {
845 845
                     $config->setSecondLevelCacheEnabled();
846 846
                     $cacheConfig = $config->getSecondLevelCacheConfiguration();
847 847
                     $regionConfig = $cacheConfig->getRegionsConfiguration();
@@ -930,31 +930,31 @@  discard block
 block discarded – undo
930 930
             array('^/mypage', 'ROLE_USER', $channel),
931 931
         );
932 932
 
933
-        $this['eccube.password_encoder'] = function ($app) {
933
+        $this['eccube.password_encoder'] = function($app) {
934 934
             return new \Eccube\Security\Core\Encoder\PasswordEncoder($app['config']);
935 935
         };
936
-        $this['security.encoder_factory'] = function ($app) {
936
+        $this['security.encoder_factory'] = function($app) {
937 937
             return new \Symfony\Component\Security\Core\Encoder\EncoderFactory(array(
938 938
                 'Eccube\Entity\Customer' => $app['eccube.password_encoder'],
939 939
                 'Eccube\Entity\Member' => $app['eccube.password_encoder'],
940 940
             ));
941 941
         };
942
-        $this['eccube.event_listner.security'] = function ($app) {
942
+        $this['eccube.event_listner.security'] = function($app) {
943 943
             return new \Eccube\EventListener\SecurityEventListener($app['orm.em']);
944 944
         };
945 945
 
946 946
         // Voterの設定
947
-        $this['authority_voter'] = function ($app) {
947
+        $this['authority_voter'] = function($app) {
948 948
             return new \Eccube\Security\Voter\AuthorityVoter($app);
949 949
         };
950 950
 
951
-        $this->extend('security.voters', function ($voters, \Silex\Application $app) {
951
+        $this->extend('security.voters', function($voters, \Silex\Application $app) {
952 952
             $voters[] = $app['authority_voter'];
953 953
 
954 954
             return $voters;
955 955
         });
956 956
 
957
-        $this['security.access_manager'] = function ($app) {
957
+        $this['security.access_manager'] = function($app) {
958 958
             return new \Symfony\Component\Security\Core\Authorization\AccessDecisionManager($app['security.voters'], 'unanimous');
959 959
         };
960 960
 
@@ -969,7 +969,7 @@  discard block
 block discarded – undo
969 969
         // ロードバランサやプロキシの設定をする
970 970
         $config = $this['config'];
971 971
         if (isset($config['trusted_proxies_connection_only']) && !empty($config['trusted_proxies_connection_only'])) {
972
-            $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($config) {
972
+            $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($config) {
973 973
                 // サブリクエストのREMOTE_ADDRも動的に設定を行う必要があるため、KernelEvents::REQUESTを使用する
974 974
                 Request::setTrustedProxies(array_merge(array($event->getRequest()->server->get('REMOTE_ADDR')), $config['trusted_proxies']));
975 975
             }, self::EARLY_EVENT);
@@ -988,7 +988,7 @@  discard block
 block discarded – undo
988 988
         $this->register(new ServiceProvider\EccubePluginServiceProvider());
989 989
 
990 990
         // TODO Acme\ServiceProvider の初期化はここで OK?
991
-        if (array_key_exists('service',$this['config'])) {
991
+        if (array_key_exists('service', $this['config'])) {
992 992
             foreach ($this['config']['service'] as $service) {
993 993
                 $this->register(new $service);
994 994
             }
@@ -1110,7 +1110,7 @@  discard block
 block discarded – undo
1110 1110
         $app = $this;
1111 1111
 
1112 1112
         // Response Event(http cache対応、event実行は一番遅く設定)
1113
-        $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) {
1113
+        $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) {
1114 1114
 
1115 1115
             if (!$event->isMasterRequest()) {
1116 1116
                 return;
Please login to merge, or discard this patch.