@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | } else { |
94 | 94 | // httpから変更されたらfalseのまま |
95 | 95 | $config['force_ssl'] = Constant::DISABLED; |
96 | - $data['force_ssl'] = (bool)Constant::DISABLED; |
|
96 | + $data['force_ssl'] = (bool) Constant::DISABLED; |
|
97 | 97 | } |
98 | 98 | } else { |
99 | 99 | $config['force_ssl'] = Constant::DISABLED; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | if (count($allowHost) > 0) { |
139 | 139 | $form->get('admin_allow_hosts')->setData(StringUtil::convertLineFeed(implode("\n", $allowHost))); |
140 | 140 | } |
141 | - $form->get('force_ssl')->setData((bool)$this->appConfig['force_ssl']); |
|
141 | + $form->get('force_ssl')->setData((bool) $this->appConfig['force_ssl']); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | return [ |
@@ -212,7 +212,7 @@ |
||
212 | 212 | |
213 | 213 | // ロードバランサ, プロキシサーバ |
214 | 214 | if (!empty($config['trusted_proxies_connection_only'])) { |
215 | - $sessionData['trusted_proxies_connection_only'] = (bool)$config['trusted_proxies_connection_only']; |
|
215 | + $sessionData['trusted_proxies_connection_only'] = (bool) $config['trusted_proxies_connection_only']; |
|
216 | 216 | } |
217 | 217 | if (!empty($config['trusted_proxies'])) { |
218 | 218 | $sessionData['trusted_proxies'] = StringUtil::convertLineFeed(implode("\n", |
@@ -44,7 +44,7 @@ |
||
44 | 44 | |
45 | 45 | public function updateSchema($generatedFiles, $proxiesDirectory) |
46 | 46 | { |
47 | - $outputDir = sys_get_temp_dir() . '/proxy_' . StringUtil::random(12); |
|
47 | + $outputDir = sys_get_temp_dir().'/proxy_'.StringUtil::random(12); |
|
48 | 48 | mkdir($outputDir); |
49 | 49 | |
50 | 50 | try { |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | { |
182 | 182 | // Proxyのクラスをロードせずにスキーマを更新するために、 |
183 | 183 | // インストール時には一時的なディレクトリにProxyを生成する |
184 | - $tmpProxyOutputDir = sys_get_temp_dir() . '/proxy_' . StringUtil::random(12); |
|
184 | + $tmpProxyOutputDir = sys_get_temp_dir().'/proxy_'.StringUtil::random(12); |
|
185 | 185 | @mkdir($tmpProxyOutputDir); |
186 | 186 | |
187 | 187 | try { |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | if (!empty($config_cache)) { |
248 | 248 | $meta = $config_cache; |
249 | 249 | } else { |
250 | - $meta = $this->readYml($dir . '/config.yml'); |
|
250 | + $meta = $this->readYml($dir.'/config.yml'); |
|
251 | 251 | } |
252 | 252 | } catch (\Symfony\Component\Yaml\Exception\ParseException $e) { |
253 | 253 | throw new PluginException($e->getMessage(), $e->getCode(), $e); |
@@ -856,7 +856,7 @@ discard block |
||
856 | 856 | { |
857 | 857 | $result = array_keys($packages); |
858 | 858 | if ($getVersion) { |
859 | - $result = array_map(function ($package, $version) { |
|
859 | + $result = array_map(function($package, $version) { |
|
860 | 860 | return $package.':'.$version; |
861 | 861 | }, array_keys($packages), array_values($packages)); |
862 | 862 | } |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | return $value; |
160 | 160 | } |
161 | 161 | |
162 | - return rtrim(mb_substr($value, 0, $length, 'UTF-8')) . $end; |
|
162 | + return rtrim(mb_substr($value, 0, $length, 'UTF-8')).$end; |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | |
@@ -186,18 +186,18 @@ discard block |
||
186 | 186 | } |
187 | 187 | if ($diff->m == 1 || $diff->days > 0) { |
188 | 188 | if ($diff->days <= 31) { |
189 | - return $diff->days . '日前'; |
|
189 | + return $diff->days.'日前'; |
|
190 | 190 | } |
191 | 191 | // return $date->format("Y/m/d H:i"); |
192 | 192 | return $date->format("Y/m/d"); |
193 | 193 | } |
194 | 194 | if ($diff->h > 0) { |
195 | - return $diff->h . "時間前"; |
|
195 | + return $diff->h."時間前"; |
|
196 | 196 | } |
197 | 197 | if ($diff->i > 0) { |
198 | - return $diff->i . "分前"; |
|
198 | + return $diff->i."分前"; |
|
199 | 199 | } |
200 | - return $diff->s . "秒前"; |
|
200 | + return $diff->s."秒前"; |
|
201 | 201 | } |
202 | 202 | |
203 | 203 | /** |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | // 支払い方法のプルダウンを生成 |
111 | 111 | $builder->addEventListener( |
112 | 112 | FormEvents::PRE_SET_DATA, |
113 | - function (FormEvent $event) { |
|
113 | + function(FormEvent $event) { |
|
114 | 114 | /** @var Order $Order */ |
115 | 115 | $Order = $event->getData(); |
116 | 116 | if (is_null($Order) || !$Order->getId()) { |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | // TODO Calculatorで行うのが適切. |
159 | 159 | $builder->addEventListener( |
160 | 160 | FormEvents::POST_SUBMIT, |
161 | - function (FormEvent $event) { |
|
161 | + function(FormEvent $event) { |
|
162 | 162 | /** @var Order $Order */ |
163 | 163 | $Order = $event->getData(); |
164 | 164 | // XXX 非会員購入の際, use_point が null で submit される? |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | { |
13 | 13 | public function register(Container $app) |
14 | 14 | { |
15 | - $app['eccube.di'] = function (Container $app) { |
|
15 | + $app['eccube.di'] = function(Container $app) { |
|
16 | 16 | $di = new DependencyBuilder( |
17 | 17 | $app['eccube.di.generator.dir'], |
18 | 18 | $app['eccube.di.generator.class'], |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | // XXX これを入れないと EntityEventDispatcher が有効になった時テストがコケる |
39 | 39 | if (!$app->offsetExists('eccube.event.dispatcher')) { |
40 | - $app['eccube.event.dispatcher'] = function () use ($app) { |
|
40 | + $app['eccube.event.dispatcher'] = function() use ($app) { |
|
41 | 41 | return $app['dispatcher']; |
42 | 42 | }; |
43 | 43 | } |
@@ -38,7 +38,7 @@ |
||
38 | 38 | */ |
39 | 39 | public function register(Container $app) |
40 | 40 | { |
41 | - $app['eccube.service.composer'] = function () use ($app) { |
|
41 | + $app['eccube.service.composer'] = function() use ($app) { |
|
42 | 42 | /**@var \Eccube\Service\SystemService $systemService */ |
43 | 43 | $systemService = $app['eccube.service.system']; |
44 | 44 | $composerMemory = $app['config']['composer_memory_limit']; |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $this->register(new MobileDetectServiceProvider()); |
237 | 237 | $this->register(new TwigLintServiceProvider()); |
238 | 238 | |
239 | - $this->error(function (\Exception $e, Request $request, $code) { |
|
239 | + $this->error(function(\Exception $e, Request $request, $code) { |
|
240 | 240 | if ($this['debug']) { |
241 | 241 | return; |
242 | 242 | } |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | |
302 | 302 | $pluginSubDirs = (function($dirName) use ($enabledPluginDirs) { |
303 | 303 | return array_map(function($pluginDir) use ($dirName) { |
304 | - return $pluginDir . '/' . $dirName; |
|
304 | + return $pluginDir.'/'.$dirName; |
|
305 | 305 | }, $enabledPluginDirs); |
306 | 306 | }); |
307 | 307 | |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | return $router; |
379 | 379 | }); |
380 | 380 | |
381 | - $this['eccube.router.origin'] = function ($app) { |
|
381 | + $this['eccube.router.origin'] = function($app) { |
|
382 | 382 | $resource = __DIR__.'/Controller'; |
383 | 383 | $cachePrefix = 'Origin'; |
384 | 384 | |
@@ -388,7 +388,7 @@ discard block |
||
388 | 388 | $this['eccube.routers.plugin'] = []; |
389 | 389 | |
390 | 390 | if (isset($this['config']['vendor_dir']) && file_exists($this['config']['vendor_dir'].'/Controller')) { |
391 | - $this['eccube.router.extend'] = function ($app) { |
|
391 | + $this['eccube.router.extend'] = function($app) { |
|
392 | 392 | $resource = $app['config']['vendor_dir'].'/Controller'; |
393 | 393 | $cachePrefix = 'Extend'; |
394 | 394 | |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | return $router; |
398 | 398 | }; |
399 | 399 | } |
400 | - $this->extend('request_matcher', function ($matcher, $app) { |
|
400 | + $this->extend('request_matcher', function($matcher, $app) { |
|
401 | 401 | $matchers = []; |
402 | 402 | if (isset($app['eccube.router.extend'])) { |
403 | 403 | $matchers[] = $app['eccube.router.extend']; |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | return new ChainUrlMatcher($matchers, $app['request_context']); |
412 | 412 | }); |
413 | 413 | |
414 | - $this->extend('url_generator', function ($generator, $app) { |
|
414 | + $this->extend('url_generator', function($generator, $app) { |
|
415 | 415 | $generators = []; |
416 | 416 | if (isset($app['eccube.router.extend'])) { |
417 | 417 | $generators[] = $app['eccube.router.extend']; |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | }); |
427 | 427 | |
428 | 428 | // Route CollectionにEC-CUBEで定義したルーティングを追加(debug tool barに出力するため) |
429 | - $this->extend('routes', function ($routes, $app) { |
|
429 | + $this->extend('routes', function($routes, $app) { |
|
430 | 430 | if (isset($app['eccube.router.extend'])) { |
431 | 431 | $routes->addCollection($app['eccube.router.extend']->getRouteCollection()); |
432 | 432 | } |
@@ -461,7 +461,7 @@ discard block |
||
461 | 461 | 'translator.cache_dir' => $this['debug'] ? null : $this['config']['root_dir'].'/app/cache/translator', |
462 | 462 | 'locale_fallbacks' => [$this['config']['locale'], 'en'], |
463 | 463 | )); |
464 | - $this->extend('translator', function ($translator, \Silex\Application $app) { |
|
464 | + $this->extend('translator', function($translator, \Silex\Application $app) { |
|
465 | 465 | $translator->addLoader('php', new \Symfony\Component\Translation\Loader\PhpFileLoader()); |
466 | 466 | |
467 | 467 | $file = __DIR__.'/Resource/locale/messages.'.$app['locale'].'.php'; |
@@ -504,7 +504,7 @@ discard block |
||
504 | 504 | $this->register(new \Silex\Provider\TwigServiceProvider(), array( |
505 | 505 | 'twig.form.templates' => array('Form/form_div_layout.twig'), |
506 | 506 | )); |
507 | - $this->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
507 | + $this->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
508 | 508 | $twig->addExtension(new \Eccube\Twig\Extension\EccubeExtension($app)); |
509 | 509 | $twig->addExtension(new \Twig_Extension_StringLoader()); |
510 | 510 | |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | return $runtimes; |
523 | 523 | }); |
524 | 524 | |
525 | - $this->before(function (Request $request, \Silex\Application $app) { |
|
525 | + $this->before(function(Request $request, \Silex\Application $app) { |
|
526 | 526 | $app['admin'] = $app['front'] = false; |
527 | 527 | $pathinfo = rawurldecode($request->getPathInfo()); |
528 | 528 | if (strpos($pathinfo, '/'.trim($app['config']['admin_route'], '/').'/') === 0) { |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | } |
539 | 539 | $paths[] = $app['config']['template_admin_realdir']; |
540 | 540 | $paths[] = __DIR__.'/../../app/Plugin'; |
541 | - $cacheDir = __DIR__.'/../../app/cache/twig/admin'; |
|
541 | + $cacheDir = __DIR__.'/../../app/cache/twig/admin'; |
|
542 | 542 | } else { |
543 | 543 | // モバイル端末時、smartphoneディレクトリを探索パスに追加する. |
544 | 544 | if ($app['mobile_detect.device_type'] == \Eccube\Entity\Master\DeviceType::DEVICE_TYPE_SP) { |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | } |
554 | 554 | $paths[] = $app['config']['template_default_realdir']; |
555 | 555 | $paths[] = __DIR__.'/../../app/Plugin'; |
556 | - $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
|
556 | + $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
|
557 | 557 | } |
558 | 558 | $app['twig']->setCache($app['debug'] ? null : $cacheDir); |
559 | 559 | $app['twig.loader']->addLoader(new \Twig_Loader_Filesystem($paths)); |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | }, self::EARLY_EVENT); |
572 | 572 | |
573 | 573 | // twigのグローバル変数を定義. |
574 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
574 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
575 | 575 | // 未ログイン時にマイページや管理画面以下にアクセスするとSubRequestで実行されるため, |
576 | 576 | // $event->isMasterRequest()ではなく、グローバル変数が初期化済かどうかの判定を行う |
577 | 577 | if (isset($this['twig_global_initialized']) && $this['twig_global_initialized'] === true) { |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | // メール送信時の文字エンコード指定(デフォルトはUTF-8) |
657 | 657 | if (isset($this['config']['mail']['charset_iso_2022_jp']) && is_bool($this['config']['mail']['charset_iso_2022_jp'])) { |
658 | 658 | if ($this['config']['mail']['charset_iso_2022_jp'] === true) { |
659 | - \Swift::init(function () { |
|
659 | + \Swift::init(function() { |
|
660 | 660 | \Swift_DependencyContainer::getInstance() |
661 | 661 | ->register('mime.qpheaderencoder') |
662 | 662 | ->asAliasOf('mime.base64headerencoder'); |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | $this->register(new \Saxulum\DoctrineOrmManagerRegistry\Provider\DoctrineOrmManagerRegistryProvider()); |
692 | 692 | |
693 | 693 | $app = $this; |
694 | - $this->extend('db.event_manager', function ($evm) use ($app) { |
|
694 | + $this->extend('db.event_manager', function($evm) use ($app) { |
|
695 | 695 | $initSubscriber = new InitSubscriber($app); |
696 | 696 | $evm->addEventSubscriber($initSubscriber); |
697 | 697 | |
@@ -808,7 +808,7 @@ discard block |
||
808 | 808 | |
809 | 809 | $this->extend( |
810 | 810 | 'orm.em.config', |
811 | - function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
811 | + function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
812 | 812 | |
813 | 813 | /** @var $chain \Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain */ |
814 | 814 | $chain = $config->getMetadataDriverImpl(); |
@@ -830,7 +830,7 @@ discard block |
||
830 | 830 | } |
831 | 831 | ); |
832 | 832 | |
833 | - $this->extend('orm.em', function (\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
833 | + $this->extend('orm.em', function(\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
834 | 834 | // save |
835 | 835 | $saveEventSubscriber = new \Eccube\Doctrine\EventSubscriber\SaveEventSubscriber($app); |
836 | 836 | $em->getEventManager()->addEventSubscriber($saveEventSubscriber); |
@@ -855,7 +855,7 @@ discard block |
||
855 | 855 | // second level cacheの設定. |
856 | 856 | $this->extend( |
857 | 857 | 'orm.em.config', |
858 | - function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
858 | + function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
859 | 859 | $config->setSecondLevelCacheEnabled(); |
860 | 860 | $cacheConfig = $config->getSecondLevelCacheConfiguration(); |
861 | 861 | $regionConfig = $cacheConfig->getRegionsConfiguration(); |
@@ -944,31 +944,31 @@ discard block |
||
944 | 944 | array('^/mypage', 'ROLE_USER', $channel), |
945 | 945 | ); |
946 | 946 | |
947 | - $this['eccube.password_encoder'] = function ($app) { |
|
947 | + $this['eccube.password_encoder'] = function($app) { |
|
948 | 948 | return new \Eccube\Security\Core\Encoder\PasswordEncoder($app['config']); |
949 | 949 | }; |
950 | - $this['security.encoder_factory'] = function ($app) { |
|
950 | + $this['security.encoder_factory'] = function($app) { |
|
951 | 951 | return new \Symfony\Component\Security\Core\Encoder\EncoderFactory(array( |
952 | 952 | 'Eccube\Entity\Customer' => $app['eccube.password_encoder'], |
953 | 953 | 'Eccube\Entity\Member' => $app['eccube.password_encoder'], |
954 | 954 | )); |
955 | 955 | }; |
956 | - $this['eccube.event_listner.security'] = function ($app) { |
|
956 | + $this['eccube.event_listner.security'] = function($app) { |
|
957 | 957 | return new \Eccube\EventListener\SecurityEventListener($app['orm.em']); |
958 | 958 | }; |
959 | 959 | |
960 | 960 | // Voterの設定 |
961 | - $this['authority_voter'] = function ($app) { |
|
961 | + $this['authority_voter'] = function($app) { |
|
962 | 962 | return new \Eccube\Security\Voter\AuthorityVoter($app); |
963 | 963 | }; |
964 | 964 | |
965 | - $this->extend('security.voters', function ($voters, \Silex\Application $app) { |
|
965 | + $this->extend('security.voters', function($voters, \Silex\Application $app) { |
|
966 | 966 | $voters[] = $app['authority_voter']; |
967 | 967 | |
968 | 968 | return $voters; |
969 | 969 | }); |
970 | 970 | |
971 | - $this['security.access_manager'] = function ($app) { |
|
971 | + $this['security.access_manager'] = function($app) { |
|
972 | 972 | return new \Symfony\Component\Security\Core\Authorization\AccessDecisionManager($app['security.voters'], 'unanimous'); |
973 | 973 | }; |
974 | 974 | |
@@ -983,7 +983,7 @@ discard block |
||
983 | 983 | // ロードバランサやプロキシの設定をする |
984 | 984 | $config = $this['config']; |
985 | 985 | if (isset($config['trusted_proxies_connection_only']) && !empty($config['trusted_proxies_connection_only'])) { |
986 | - $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($config) { |
|
986 | + $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($config) { |
|
987 | 987 | // サブリクエストのREMOTE_ADDRも動的に設定を行う必要があるため、KernelEvents::REQUESTを使用する |
988 | 988 | Request::setTrustedProxies(array_merge(array($event->getRequest()->server->get('REMOTE_ADDR')), $config['trusted_proxies'])); |
989 | 989 | }, self::EARLY_EVENT); |
@@ -1002,7 +1002,7 @@ discard block |
||
1002 | 1002 | $this->register(new ServiceProvider\EccubePluginServiceProvider()); |
1003 | 1003 | |
1004 | 1004 | // TODO Acme\ServiceProvider の初期化はここで OK? |
1005 | - if (array_key_exists('service',$this['config'])) { |
|
1005 | + if (array_key_exists('service', $this['config'])) { |
|
1006 | 1006 | foreach ($this['config']['service'] as $service) { |
1007 | 1007 | $this->register(new $service); |
1008 | 1008 | } |
@@ -1124,7 +1124,7 @@ discard block |
||
1124 | 1124 | $app = $this; |
1125 | 1125 | |
1126 | 1126 | // Response Event(http cache対応、event実行は一番遅く設定) |
1127 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
1127 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
1128 | 1128 | |
1129 | 1129 | if (!$event->isMasterRequest()) { |
1130 | 1130 | return; |