@@ -38,21 +38,21 @@ |
||
38 | 38 | */ |
39 | 39 | public function buildForm(FormBuilderInterface $builder, array $options) |
40 | 40 | { |
41 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
42 | - $options = $event->getForm()->getConfig()->getOptions(); |
|
43 | - if (!$event->getData()) { |
|
44 | - $data = current(array_keys($options['choice_loader']->loadChoiceList()->getValues())); |
|
45 | - $event->setData($data); |
|
46 | - } |
|
47 | - }); |
|
48 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { |
|
49 | - $options = $event->getForm()->getConfig()->getOptions(); |
|
50 | - $values = $options['choice_loader']->loadChoiceList()->getValues(); |
|
51 | - if (!in_array($event->getData(), $values)) { |
|
52 | - $data = current($values); |
|
53 | - $event->setData($data); |
|
54 | - } |
|
55 | - }); |
|
41 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
42 | + $options = $event->getForm()->getConfig()->getOptions(); |
|
43 | + if (!$event->getData()) { |
|
44 | + $data = current(array_keys($options['choice_loader']->loadChoiceList()->getValues())); |
|
45 | + $event->setData($data); |
|
46 | + } |
|
47 | + }); |
|
48 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { |
|
49 | + $options = $event->getForm()->getConfig()->getOptions(); |
|
50 | + $values = $options['choice_loader']->loadChoiceList()->getValues(); |
|
51 | + if (!in_array($event->getData(), $values)) { |
|
52 | + $data = current($values); |
|
53 | + $event->setData($data); |
|
54 | + } |
|
55 | + }); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -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)) { |
@@ -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) |
@@ -24,18 +24,15 @@ |
||
24 | 24 | |
25 | 25 | namespace Eccube\ServiceProvider; |
26 | 26 | |
27 | -use Eccube\Common\Constant; |
|
28 | 27 | use Eccube\DataCollector\EccubeDataCollector; |
29 | 28 | use Pimple\Container; |
30 | 29 | use Pimple\ServiceProviderInterface; |
31 | 30 | use Silex\Api\BootableProviderInterface; |
32 | 31 | use Silex\Application; |
33 | 32 | use Symfony\Bridge\Twig\Extension\DumpExtension; |
34 | -use Symfony\Component\EventDispatcher\EventDispatcherInterface; |
|
35 | 33 | use Symfony\Component\HttpKernel\DataCollector\DumpDataCollector; |
36 | 34 | use Symfony\Component\HttpKernel\EventListener\DumpListener; |
37 | 35 | use Symfony\Component\VarDumper\Cloner\VarCloner; |
38 | -use Symfony\Component\VarDumper\Dumper\CliDumper; |
|
39 | 36 | use Symfony\Component\VarDumper\Dumper\HtmlDumper; |
40 | 37 | use Symfony\Component\VarDumper\VarDumper; |
41 | 38 |
@@ -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 |
@@ -2,14 +2,9 @@ |
||
2 | 2 | namespace Acme\Controller; |
3 | 3 | |
4 | 4 | use Eccube\Application; |
5 | -use Symfony\Component\HttpFoundation\Response; |
|
6 | 5 | use Symfony\Component\HttpFoundation\Request; |
7 | -use Symfony\Component\HttpFoundation\ParameterBag; |
|
8 | 6 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
9 | -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; |
|
10 | -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; |
|
11 | 7 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; |
12 | -use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; |
|
13 | 8 | |
14 | 9 | /** |
15 | 10 | * @Route("/test") |
@@ -16,7 +16,7 @@ |
||
16 | 16 | * @Security("has_role('ROLE_ADMIN')") |
17 | 17 | * |
18 | 18 | * @param Application $app |
19 | - * @return \Symfony\Component\HttpFoundation\Response |
|
19 | + * @return string |
|
20 | 20 | */ |
21 | 21 | public function testAdmin(Application $app) |
22 | 22 | { |
@@ -3,7 +3,6 @@ |
||
3 | 3 | namespace Acme\Controller; |
4 | 4 | |
5 | 5 | use Eccube\Application; |
6 | -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; |
|
7 | 6 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
8 | 7 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; |
9 | 8 |
@@ -4,13 +4,10 @@ |
||
4 | 4 | use Eccube\Application; |
5 | 5 | use Symfony\Component\HttpFoundation\Response; |
6 | 6 | use Symfony\Component\HttpFoundation\Request; |
7 | -use Symfony\Component\HttpFoundation\ParameterBag; |
|
8 | -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; |
|
9 | 7 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
10 | 8 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; |
11 | 9 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; |
12 | 10 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; |
13 | -use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; |
|
14 | 11 | |
15 | 12 | /** |
16 | 13 | * @Route("/test") |
@@ -65,7 +65,7 @@ |
||
65 | 65 | ->add('name', TextType::class, array( |
66 | 66 | 'required' => false, |
67 | 67 | )) |
68 | - ->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($app) { |
|
68 | + ->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) use ($app) { |
|
69 | 69 | $form = $event->getForm(); |
70 | 70 | $data = $form->getData(); |
71 | 71 | if (strlen($data['id']) && strlen($data['name']) == 0) { |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $app->match('/plugin/[lower_code]/hello', 'Plugin\[code]\Controller\[code]Controller::index')->bind('plugin_[code]_hello'); |
34 | 34 | |
35 | 35 | // Form |
36 | - $app['form.types'] = $app->extend('form.types', function ($types) use ($app) { |
|
36 | + $app['form.types'] = $app->extend('form.types', function($types) use ($app) { |
|
37 | 37 | $types[] = new [code]ConfigType(); |
38 | 38 | |
39 | 39 | return $types; |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | // } |
58 | 58 | |
59 | 59 | // ログファイル設定 |
60 | - $app['monolog.logger.[lower_code]'] = function ($app) { |
|
60 | + $app['monolog.logger.[lower_code]'] = function($app) { |
|
61 | 61 | |
62 | 62 | $logger = new $app['monolog.logger.class']('[lower_code]'); |
63 | 63 |