@@ -45,7 +45,7 @@ |
||
45 | 45 | @trigger_error('The '.__METHOD__.' method is deprecated.', E_USER_DEPRECATED); |
46 | 46 | |
47 | 47 | $form = $app['form.factory'] |
48 | - ->createBuilder($app['eccube.form.type.' . $type], $app['eccube.entity.' . $type]) |
|
48 | + ->createBuilder($app['eccube.form.type.'.$type], $app['eccube.entity.'.$type]) |
|
49 | 49 | ->getForm(); |
50 | 50 | $form->handleRequest($app['request_stack']->getCurrentRequest()); |
51 | 51 |
@@ -38,14 +38,14 @@ |
||
38 | 38 | */ |
39 | 39 | public function buildForm(FormBuilderInterface $builder, array $options) |
40 | 40 | { |
41 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
41 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
42 | 42 | $options = $event->getForm()->getConfig()->getOptions(); |
43 | 43 | if (!$event->getData()) { |
44 | 44 | $data = current(array_keys($options['choice_loader']->loadChoiceList()->getValues())); |
45 | 45 | $event->setData($data); |
46 | 46 | } |
47 | 47 | }); |
48 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { |
|
48 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) { |
|
49 | 49 | $options = $event->getForm()->getConfig()->getOptions(); |
50 | 50 | $values = $options['choice_loader']->loadChoiceList()->getValues(); |
51 | 51 | if (!in_array($event->getData(), $values)) { |
@@ -38,14 +38,14 @@ |
||
38 | 38 | */ |
39 | 39 | public function buildForm(FormBuilderInterface $builder, array $options) |
40 | 40 | { |
41 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
41 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
42 | 42 | $options = $event->getForm()->getConfig()->getOptions(); |
43 | 43 | if (!$event->getData()) { |
44 | 44 | $data = current(array_keys($options['choice_loader']->loadChoiceList()->getValues())); |
45 | 45 | $event->setData($data); |
46 | 46 | } |
47 | 47 | }); |
48 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { |
|
48 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) { |
|
49 | 49 | $options = $event->getForm()->getConfig()->getOptions(); |
50 | 50 | $values = $options['choice_loader']->loadChoiceList()->getValues(); |
51 | 51 | if (!in_array($event->getData(), $values)) { |
@@ -42,7 +42,7 @@ |
||
42 | 42 | 'expanded' => false, |
43 | 43 | 'required' => false, |
44 | 44 | 'placeholder' => false, |
45 | - 'query_builder' => function (EntityRepository $er) { |
|
45 | + 'query_builder' => function(EntityRepository $er) { |
|
46 | 46 | return $er->createQueryBuilder('m') |
47 | 47 | ->orderBy('m.rank', 'ASC'); |
48 | 48 | }, |
@@ -38,14 +38,14 @@ |
||
38 | 38 | */ |
39 | 39 | public function buildForm(FormBuilderInterface $builder, array $options) |
40 | 40 | { |
41 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
41 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
42 | 42 | $options = $event->getForm()->getConfig()->getOptions(); |
43 | 43 | if (!$event->getData()) { |
44 | 44 | $data = current(array_keys($options['choice_loader']->loadChoiceList()->getValues())); |
45 | 45 | $event->setData($data); |
46 | 46 | } |
47 | 47 | }); |
48 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { |
|
48 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) { |
|
49 | 49 | $options = $event->getForm()->getConfig()->getOptions(); |
50 | 50 | $values = $options['choice_loader']->loadChoiceList()->getValues(); |
51 | 51 | if (!in_array($event->getData(), $values)) { |
@@ -17,7 +17,7 @@ |
||
17 | 17 | { |
18 | 18 | $Table = $schema->getTable('dtb_payment'); |
19 | 19 | if (!$Table->hasColumn('use_paypal')) { |
20 | - $Table->addColumn('use_paypal','smallint', [ |
|
20 | + $Table->addColumn('use_paypal', 'smallint', [ |
|
21 | 21 | 'notnull' => false, |
22 | 22 | 'default' => 0 |
23 | 23 | ]); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | public function setRequireHttps($requireHttps) |
16 | 16 | { |
17 | - $this->requireHttps = (bool)$requireHttps; |
|
17 | + $this->requireHttps = (bool) $requireHttps; |
|
18 | 18 | } |
19 | 19 | |
20 | 20 | public function setAdminPrefix($adminPrefix) |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | { |
73 | 73 | public function register(Container $app) |
74 | 74 | { |
75 | - $app['var_dumper.cloner'] = function ($app) { |
|
75 | + $app['var_dumper.cloner'] = function($app) { |
|
76 | 76 | $cloner = new VarCloner(); |
77 | 77 | |
78 | 78 | if (isset($app['debug.max_items'])) { |
@@ -86,37 +86,37 @@ discard block |
||
86 | 86 | return $cloner; |
87 | 87 | }; |
88 | 88 | |
89 | - $app->extend('data_collector.templates', function ($templates) { |
|
89 | + $app->extend('data_collector.templates', function($templates) { |
|
90 | 90 | return array_merge($templates, array(array('dump', '@Debug/Profiler/dump.html.twig'))); |
91 | 91 | }); |
92 | 92 | |
93 | - $app['data_collector.dump'] = function ($app) { |
|
93 | + $app['data_collector.dump'] = function($app) { |
|
94 | 94 | return new DumpDataCollector($app['stopwatch'], $app['code.file_link_format'], null, null, new HtmlDumper()); |
95 | 95 | }; |
96 | 96 | |
97 | - $app->extend('data_collectors', function ($collectors, $app) { |
|
98 | - $collectors['dump'] = function ($app) { |
|
97 | + $app->extend('data_collectors', function($collectors, $app) { |
|
98 | + $collectors['dump'] = function($app) { |
|
99 | 99 | return $app['data_collector.dump']; |
100 | 100 | }; |
101 | 101 | |
102 | - $collectors['eccube'] = function ($app) { |
|
102 | + $collectors['eccube'] = function($app) { |
|
103 | 103 | return new EccubeDataCollector($app); |
104 | 104 | }; |
105 | 105 | return $collectors; |
106 | 106 | }); |
107 | 107 | |
108 | - $app->extend('data_collector.templates', function ($templates, $app) { |
|
108 | + $app->extend('data_collector.templates', function($templates, $app) { |
|
109 | 109 | array_unshift($templates, ['eccube', '@EccubeProfiler/eccube.html.twig']); |
110 | 110 | return $templates; |
111 | 111 | } |
112 | 112 | ); |
113 | 113 | |
114 | - $app->extend('twig.loader.filesystem', function ($filesystem, $app) { |
|
114 | + $app->extend('twig.loader.filesystem', function($filesystem, $app) { |
|
115 | 115 | return $filesystem; |
116 | 116 | } |
117 | 117 | ); |
118 | 118 | |
119 | - $app->extend('twig', function ($twig, $app) { |
|
119 | + $app->extend('twig', function($twig, $app) { |
|
120 | 120 | if (class_exists('\Symfony\Bridge\Twig\Extension\DumpExtension')) { |
121 | 121 | $twig->addExtension(new DumpExtension($app['var_dumper.cloner'])); |
122 | 122 | } |
@@ -124,14 +124,14 @@ discard block |
||
124 | 124 | return $twig; |
125 | 125 | }); |
126 | 126 | |
127 | - $app->extend('twig.loader.filesystem', function ($loader, $app) { |
|
127 | + $app->extend('twig.loader.filesystem', function($loader, $app) { |
|
128 | 128 | $loader->addPath($app['debug.templates_path'], 'Debug'); |
129 | 129 | $loader->addPath(__DIR__.'/../Resource/template/toolbar', 'EccubeProfiler'); |
130 | 130 | |
131 | 131 | return $loader; |
132 | 132 | }); |
133 | 133 | |
134 | - $app['debug.templates_path'] = function () { |
|
134 | + $app['debug.templates_path'] = function() { |
|
135 | 135 | $r = new \ReflectionClass('Symfony\Bundle\DebugBundle\DependencyInjection\Configuration'); |
136 | 136 | |
137 | 137 | return dirname(dirname($r->getFileName())).'/Resources/views'; |
@@ -143,11 +143,11 @@ discard block |
||
143 | 143 | // This code is here to lazy load the dump stack. This default |
144 | 144 | // configuration for CLI mode is overridden in HTTP mode on |
145 | 145 | // 'kernel.request' event |
146 | - VarDumper::setHandler(function ($var) use ($app) { |
|
146 | + VarDumper::setHandler(function($var) use ($app) { |
|
147 | 147 | $dumper = $app['data_collector.dump']; |
148 | 148 | $cloner = $app['var_dumper.cloner']; |
149 | 149 | |
150 | - $handler = function ($var) use ($dumper, $cloner) { |
|
150 | + $handler = function($var) use ($dumper, $cloner) { |
|
151 | 151 | $dumper->dump($cloner->cloneVar($var)); |
152 | 152 | }; |
153 | 153 |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $this->register(new \Silex\Provider\SerializerServiceProvider()); |
161 | 161 | $this->register(new \Silex\Provider\ValidatorServiceProvider()); |
162 | 162 | |
163 | - $this->error(function (\Exception $e, Request $request, $code) { |
|
163 | + $this->error(function(\Exception $e, Request $request, $code) { |
|
164 | 164 | if ($this['debug']) { |
165 | 165 | return; |
166 | 166 | } |
@@ -252,14 +252,14 @@ discard block |
||
252 | 252 | return $router; |
253 | 253 | }); |
254 | 254 | |
255 | - $this['eccube.router.origin'] = function ($app) { |
|
255 | + $this['eccube.router.origin'] = function($app) { |
|
256 | 256 | $resource = __DIR__.'/Controller'; |
257 | 257 | $cachePrefix = 'Origin'; |
258 | 258 | |
259 | 259 | return $app['eccube.router']($resource, $cachePrefix); |
260 | 260 | }; |
261 | 261 | |
262 | - $this['eccube.routers.plugin'] = function ($app) { |
|
262 | + $this['eccube.routers.plugin'] = function($app) { |
|
263 | 263 | // TODO 有効なプラグインを対象とする必要がある. |
264 | 264 | $dirs = Finder::create() |
265 | 265 | ->in($app['config']['root_dir'].'/app/Plugin') |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | return $routers; |
277 | 277 | }; |
278 | 278 | |
279 | - $this['eccube.router.extend'] = function ($app) { |
|
279 | + $this['eccube.router.extend'] = function($app) { |
|
280 | 280 | // TODO ディレクトリ名は暫定 |
281 | 281 | $resource = $app['config']['root_dir'].'/app/Acme/Controller'; |
282 | 282 | $cachePrefix = 'Extend'; |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | return $router; |
287 | 287 | }; |
288 | 288 | |
289 | - $this->extend('request_matcher', function ($matcher, $app) { |
|
289 | + $this->extend('request_matcher', function($matcher, $app) { |
|
290 | 290 | $matchers = []; |
291 | 291 | $matchers[] = $app['eccube.router.extend']; |
292 | 292 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | return new ChainUrlMatcher($matchers, $app['request_context']); |
299 | 299 | }); |
300 | 300 | |
301 | - $this->extend('url_generator', function ($generator, $app) { |
|
301 | + $this->extend('url_generator', function($generator, $app) { |
|
302 | 302 | $generators = []; |
303 | 303 | $generators[] = $app['eccube.router.extend']; |
304 | 304 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | 'translator.cache_dir' => $this['debug'] ? null : $this['config']['root_dir'].'/app/cache/translator', |
330 | 330 | 'locale_fallbacks' => ['ja', 'en'], |
331 | 331 | )); |
332 | - $this->extend('translator', function ($translator, \Silex\Application $app) { |
|
332 | + $this->extend('translator', function($translator, \Silex\Application $app) { |
|
333 | 333 | $translator->addLoader('yaml', new \Symfony\Component\Translation\Loader\YamlFileLoader()); |
334 | 334 | |
335 | 335 | $file = __DIR__.'/Resource/locale/validator.'.$app['locale'].'.yml'; |
@@ -376,14 +376,14 @@ discard block |
||
376 | 376 | $this->register(new \Silex\Provider\TwigServiceProvider(), array( |
377 | 377 | 'twig.form.templates' => array('Form/form_layout.twig'), |
378 | 378 | )); |
379 | - $this->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
379 | + $this->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
380 | 380 | $twig->addExtension(new \Eccube\Twig\Extension\EccubeExtension($app)); |
381 | 381 | $twig->addExtension(new \Twig_Extension_StringLoader()); |
382 | 382 | |
383 | 383 | return $twig; |
384 | 384 | }); |
385 | 385 | |
386 | - $this->before(function (Request $request, \Silex\Application $app) { |
|
386 | + $this->before(function(Request $request, \Silex\Application $app) { |
|
387 | 387 | $app['admin'] = false; |
388 | 388 | $app['front'] = false; |
389 | 389 | $pathinfo = rawurldecode($request->getPathInfo()); |
@@ -415,7 +415,7 @@ discard block |
||
415 | 415 | // フロント or 管理画面ごとにtwigの探索パスを切り替える. |
416 | 416 | if (!$app->offsetExists('twig')) { |
417 | 417 | |
418 | - $app->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
418 | + $app->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
419 | 419 | $paths = array(); |
420 | 420 | |
421 | 421 | // 互換性がないのでprofiler とproduction 時のcacheを分離する |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | }, self::EARLY_EVENT); |
463 | 463 | |
464 | 464 | // twigのグローバル変数を定義. |
465 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
465 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
466 | 466 | // 未ログイン時にマイページや管理画面以下にアクセスするとSubRequestで実行されるため, |
467 | 467 | // $event->isMasterRequest()ではなく、グローバル変数が初期化済かどうかの判定を行う |
468 | 468 | if (isset($this['twig_global_initialized']) && $this['twig_global_initialized'] === true) { |
@@ -529,7 +529,7 @@ discard block |
||
529 | 529 | // メール送信時の文字エンコード指定(デフォルトはUTF-8) |
530 | 530 | if (isset($this['config']['mail']['charset_iso_2022_jp']) && is_bool($this['config']['mail']['charset_iso_2022_jp'])) { |
531 | 531 | if ($this['config']['mail']['charset_iso_2022_jp'] === true) { |
532 | - \Swift::init(function () { |
|
532 | + \Swift::init(function() { |
|
533 | 533 | \Swift_DependencyContainer::getInstance() |
534 | 534 | ->register('mime.qpheaderencoder') |
535 | 535 | ->asAliasOf('mime.base64headerencoder'); |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | 'EXTRACT' => 'Eccube\Doctrine\ORM\Query\Extract', |
657 | 657 | ), |
658 | 658 | )); |
659 | - $this->extend('orm.em', function (\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
659 | + $this->extend('orm.em', function(\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
660 | 660 | // tax_rule |
661 | 661 | $taxRuleRepository = $em->getRepository('Eccube\Entity\TaxRule'); |
662 | 662 | $taxRuleRepository->setApplication($app); |
@@ -746,31 +746,31 @@ discard block |
||
746 | 746 | array('^/mypage', 'ROLE_USER'), |
747 | 747 | ); |
748 | 748 | |
749 | - $this['eccube.password_encoder'] = function ($app) { |
|
749 | + $this['eccube.password_encoder'] = function($app) { |
|
750 | 750 | return new \Eccube\Security\Core\Encoder\PasswordEncoder($app['config']); |
751 | 751 | }; |
752 | - $this['security.encoder_factory'] = function ($app) { |
|
752 | + $this['security.encoder_factory'] = function($app) { |
|
753 | 753 | return new \Symfony\Component\Security\Core\Encoder\EncoderFactory(array( |
754 | 754 | 'Eccube\Entity\Customer' => $app['eccube.password_encoder'], |
755 | 755 | 'Eccube\Entity\Member' => $app['eccube.password_encoder'], |
756 | 756 | )); |
757 | 757 | }; |
758 | - $this['eccube.event_listner.security'] = function ($app) { |
|
758 | + $this['eccube.event_listner.security'] = function($app) { |
|
759 | 759 | return new \Eccube\EventListener\SecurityEventListener($app['orm.em']); |
760 | 760 | }; |
761 | 761 | |
762 | 762 | // Voterの設定 |
763 | - $this['authority_voter'] = function ($app) { |
|
763 | + $this['authority_voter'] = function($app) { |
|
764 | 764 | return new \Eccube\Security\Voter\AuthorityVoter($app); |
765 | 765 | }; |
766 | 766 | |
767 | - $this->extend('security.voters', function ($voters, \Silex\Application $app) { |
|
767 | + $this->extend('security.voters', function($voters, \Silex\Application $app) { |
|
768 | 768 | $voters[] = $app['authority_voter']; |
769 | 769 | |
770 | 770 | return $voters; |
771 | 771 | }); |
772 | 772 | |
773 | - $this['security.access_manager'] = function ($app) { |
|
773 | + $this['security.access_manager'] = function($app) { |
|
774 | 774 | return new \Symfony\Component\Security\Core\Authorization\AccessDecisionManager($app['security.voters'], 'unanimous'); |
775 | 775 | }; |
776 | 776 | |
@@ -928,7 +928,7 @@ discard block |
||
928 | 928 | $app = $this; |
929 | 929 | |
930 | 930 | // Response Event(http cache対応、event実行は一番遅く設定) |
931 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
931 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
932 | 932 | |
933 | 933 | if (!$event->isMasterRequest()) { |
934 | 934 | return; |