@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | * @param array $metadatas |
349 | 349 | * @param array $fsList |
350 | 350 | * @param $pluginCode |
351 | - * @param $codePath |
|
351 | + * @param string $codePath |
|
352 | 352 | */ |
353 | 353 | protected function generateMigration(array $metadatas, array &$fsList = array(), $pluginCode, $codePath) |
354 | 354 | { |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | * |
374 | 374 | * @param $pluginCode |
375 | 375 | * @param array $metadatas |
376 | - * @return mixed|string |
|
376 | + * @return string |
|
377 | 377 | */ |
378 | 378 | protected function makeMigration($pluginCode, array $metadatas) |
379 | 379 | { |
@@ -33,7 +33,6 @@ |
||
33 | 33 | use Symfony\Component\Console\Input\InputOption; |
34 | 34 | use Symfony\Component\Console\Output\OutputInterface; |
35 | 35 | use Symfony\Component\Console\Question\Question; |
36 | -use Symfony\Component\Validator\Constraints as Assert; |
|
37 | 36 | |
38 | 37 | class PluginCommand extends \Knp\Command\Command |
39 | 38 | { |
@@ -2,15 +2,9 @@ |
||
2 | 2 | |
3 | 3 | namespace Eccube\Application; |
4 | 4 | |
5 | -use Eccube\Event\TemplateEvent; |
|
6 | -use Monolog\Logger; |
|
7 | -use Symfony\Component\Form\FormBuilder; |
|
8 | 5 | use Symfony\Component\HttpFoundation\Request; |
9 | 6 | use Symfony\Component\HttpFoundation\Response; |
10 | -use Symfony\Component\HttpFoundation\StreamedResponse; |
|
11 | 7 | use Symfony\Component\HttpKernel\HttpKernelInterface; |
12 | -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; |
|
13 | -use Symfony\Component\Security\Core\User\UserInterface; |
|
14 | 8 | |
15 | 9 | trait ApplicationTrait |
16 | 10 | { |
@@ -16,6 +16,7 @@ discard block |
||
16 | 16 | { |
17 | 17 | /** |
18 | 18 | * Application Shortcut Methods |
19 | + * @param string $message |
|
19 | 20 | */ |
20 | 21 | public function addSuccess($message, $namespace = 'front') |
21 | 22 | { |
@@ -32,6 +33,9 @@ discard block |
||
32 | 33 | $this['session']->getFlashBag()->add('eccube.' . $namespace . '.danger', $message); |
33 | 34 | } |
34 | 35 | |
36 | + /** |
|
37 | + * @param string $message |
|
38 | + */ |
|
35 | 39 | public function addWarning($message, $namespace = 'front') |
36 | 40 | { |
37 | 41 | $this['session']->getFlashBag()->add('eccube.' . $namespace . '.warning', $message); |
@@ -42,6 +46,9 @@ discard block |
||
42 | 46 | $this['session']->getFlashBag()->add('eccube.' . $namespace . '.info', $message); |
43 | 47 | } |
44 | 48 | |
49 | + /** |
|
50 | + * @param string $message |
|
51 | + */ |
|
45 | 52 | public function addRequestError($message, $namespace = 'front') |
46 | 53 | { |
47 | 54 | $this['session']->getFlashBag()->set('eccube.' . $namespace . '.request.error', $message); |
@@ -58,6 +65,9 @@ discard block |
||
58 | 65 | $this->addWarning('admin.delete.warning', 'admin'); |
59 | 66 | } |
60 | 67 | |
68 | + /** |
|
69 | + * @param string $targetPath |
|
70 | + */ |
|
61 | 71 | public function setLoginTargetPath($targetPath, $namespace = null) |
62 | 72 | { |
63 | 73 | if (is_null($namespace)) { |
@@ -109,7 +119,7 @@ discard block |
||
109 | 119 | * @param string $path フォワード先のパス |
110 | 120 | * @param array $requestParameters |
111 | 121 | * @param Response $response |
112 | - * @return Application |
|
122 | + * @return ApplicationTrait |
|
113 | 123 | */ |
114 | 124 | public function forwardChain($path, array $requestParameters = [], Response &$response = null) |
115 | 125 | { |
@@ -19,32 +19,32 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function addSuccess($message, $namespace = 'front') |
21 | 21 | { |
22 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.success', $message); |
|
22 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.success', $message); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | public function addError($message, $namespace = 'front') |
26 | 26 | { |
27 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.error', $message); |
|
27 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.error', $message); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | public function addDanger($message, $namespace = 'front') |
31 | 31 | { |
32 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.danger', $message); |
|
32 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.danger', $message); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | public function addWarning($message, $namespace = 'front') |
36 | 36 | { |
37 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.warning', $message); |
|
37 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.warning', $message); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | public function addInfo($message, $namespace = 'front') |
41 | 41 | { |
42 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.info', $message); |
|
42 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.info', $message); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | public function addRequestError($message, $namespace = 'front') |
46 | 46 | { |
47 | - $this['session']->getFlashBag()->set('eccube.' . $namespace . '.request.error', $message); |
|
47 | + $this['session']->getFlashBag()->set('eccube.'.$namespace.'.request.error', $message); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | public function clearMessage() |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | if (is_null($namespace)) { |
64 | 64 | $this['session']->getFlashBag()->set('eccube.login.target.path', $targetPath); |
65 | 65 | } else { |
66 | - $this['session']->getFlashBag()->set('eccube.' . $namespace . '.login.target.path', $targetPath); |
|
66 | + $this['session']->getFlashBag()->set('eccube.'.$namespace.'.login.target.path', $targetPath); |
|
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | * @param Response $response |
112 | 112 | * @return Application |
113 | 113 | */ |
114 | - public function forwardChain($path, array $requestParameters = [], Response &$response = null) |
|
114 | + public function forwardChain($path, array $requestParameters = [], Response&$response = null) |
|
115 | 115 | { |
116 | 116 | $response = $this->forward($path, $requestParameters); |
117 | 117 | return $this; |
@@ -52,11 +52,17 @@ |
||
52 | 52 | return $form; |
53 | 53 | } |
54 | 54 | |
55 | + /** |
|
56 | + * @param Application $app |
|
57 | + */ |
|
55 | 58 | protected function getSecurity($app) |
56 | 59 | { |
57 | 60 | return $app['security.token_storage']; |
58 | 61 | } |
59 | 62 | |
63 | + /** |
|
64 | + * @param Application $app |
|
65 | + */ |
|
60 | 66 | protected function isTokenValid($app) |
61 | 67 | { |
62 | 68 | $csrf = $app['csrf.token_manager']; |
@@ -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 |
@@ -37,6 +37,9 @@ |
||
37 | 37 | { |
38 | 38 | private $app; |
39 | 39 | |
40 | + /** |
|
41 | + * @param \Pimple\Container $app |
|
42 | + */ |
|
40 | 43 | public function __construct($app) |
41 | 44 | { |
42 | 45 | $this->app = $app; |
@@ -27,8 +27,6 @@ |
||
27 | 27 | use Symfony\Component\Form\Extension\Core\Type\PasswordType; |
28 | 28 | use Symfony\Component\Form\Extension\Core\Type\RepeatedType; |
29 | 29 | use Symfony\Component\Form\FormBuilderInterface; |
30 | -use Symfony\Component\Form\FormError; |
|
31 | -use Symfony\Component\Form\FormEvents; |
|
32 | 30 | use Symfony\Component\OptionsResolver\OptionsResolver; |
33 | 31 | use Symfony\Component\Security\Core\Validator\Constraints\UserPassword; |
34 | 32 | use Symfony\Component\Validator\Constraints as Assert; |
@@ -32,7 +32,6 @@ |
||
32 | 32 | use Symfony\Component\Form\Extension\Core\Type\HiddenType; |
33 | 33 | use Symfony\Component\Form\Extension\Core\Type\TextType; |
34 | 34 | use Symfony\Component\Form\FormBuilderInterface; |
35 | -use Symfony\Component\Validator\Constraints as Assert; |
|
36 | 35 | |
37 | 36 | class SearchProductType extends AbstractType |
38 | 37 | { |
@@ -39,7 +39,7 @@ |
||
39 | 39 | * This method should only be used to configure services and parameters. |
40 | 40 | * It should not get services. |
41 | 41 | * |
42 | - * @param BaseApplication $app An Application instance |
|
42 | + * @param Container $app An Application instance |
|
43 | 43 | */ |
44 | 44 | public function register(Container $app) |
45 | 45 | { |
@@ -45,31 +45,31 @@ discard block |
||
45 | 45 | public function register(Container $app) |
46 | 46 | { |
47 | 47 | // Service |
48 | - $app['eccube.service.system'] = function () use ($app) { |
|
48 | + $app['eccube.service.system'] = function() use ($app) { |
|
49 | 49 | return new \Eccube\Service\SystemService($app); |
50 | 50 | }; |
51 | - $app['view'] = function () use ($app) { |
|
51 | + $app['view'] = function() use ($app) { |
|
52 | 52 | return $app['twig']; |
53 | 53 | }; |
54 | - $app['eccube.service.cart'] = function () use ($app) { |
|
54 | + $app['eccube.service.cart'] = function() use ($app) { |
|
55 | 55 | return new \Eccube\Service\CartService($app); |
56 | 56 | }; |
57 | - $app['eccube.service.order'] = function () use ($app) { |
|
57 | + $app['eccube.service.order'] = function() use ($app) { |
|
58 | 58 | return new \Eccube\Service\OrderService($app); |
59 | 59 | }; |
60 | - $app['eccube.service.tax_rule'] = function () use ($app) { |
|
60 | + $app['eccube.service.tax_rule'] = function() use ($app) { |
|
61 | 61 | return new \Eccube\Service\TaxRuleService($app['eccube.repository.tax_rule']); |
62 | 62 | }; |
63 | - $app['eccube.service.plugin'] = function () use ($app) { |
|
63 | + $app['eccube.service.plugin'] = function() use ($app) { |
|
64 | 64 | return new \Eccube\Service\PluginService($app); |
65 | 65 | }; |
66 | - $app['eccube.service.mail'] = function () use ($app) { |
|
66 | + $app['eccube.service.mail'] = function() use ($app) { |
|
67 | 67 | return new \Eccube\Service\MailService($app); |
68 | 68 | }; |
69 | - $app['eccube.calculate.context'] = function () use ($app) { |
|
69 | + $app['eccube.calculate.context'] = function() use ($app) { |
|
70 | 70 | return new \Eccube\Service\Calculator\CalculateContext(); |
71 | 71 | }; |
72 | - $app['eccube.service.calculate'] = $app->protect(function ($Order, $Customer) use ($app) { |
|
72 | + $app['eccube.service.calculate'] = $app->protect(function($Order, $Customer) use ($app) { |
|
73 | 73 | $Service = new \Eccube\Service\CalculateService($Order, $Customer); |
74 | 74 | $Context = $app['eccube.calculate.context']; |
75 | 75 | $app['eccube.calculate.strategies']->setOrder($Order); |
@@ -79,13 +79,13 @@ discard block |
||
79 | 79 | return $Service; |
80 | 80 | }); |
81 | 81 | |
82 | - $app['eccube.service.payment'] = $app->protect(function ($clazz) use ($app) { |
|
82 | + $app['eccube.service.payment'] = $app->protect(function($clazz) use ($app) { |
|
83 | 83 | $Service = new $clazz; |
84 | 84 | $Service->setApplication($app); |
85 | 85 | return $Service; |
86 | 86 | }); |
87 | 87 | |
88 | - $app['eccube.calculate.strategies'] = function () use ($app) { |
|
88 | + $app['eccube.calculate.strategies'] = function() use ($app) { |
|
89 | 89 | $Collection = new \Eccube\Service\Calculator\CalculateStrategyCollection(); |
90 | 90 | $Collection->setApplication($app); |
91 | 91 | //$Collection->setOrder($Order); |
@@ -98,47 +98,47 @@ discard block |
||
98 | 98 | $Collection->add($app['eccube.calculate.strategy.calculate_total']); |
99 | 99 | return $Collection; |
100 | 100 | }; |
101 | - $app['eccube.calculate.strategy.shipping'] = function () use ($app) { |
|
101 | + $app['eccube.calculate.strategy.shipping'] = function() use ($app) { |
|
102 | 102 | $Strategy = new \Eccube\Service\Calculator\Strategy\ShippingStrategy(); |
103 | 103 | $Strategy->setApplication($app); |
104 | 104 | return $Strategy; |
105 | 105 | }; |
106 | - $app['eccube.calculate.strategy.charge'] = function () use ($app) { |
|
106 | + $app['eccube.calculate.strategy.charge'] = function() use ($app) { |
|
107 | 107 | $Strategy = new \Eccube\Service\Calculator\Strategy\ChargeStrategy(); |
108 | 108 | $Strategy->setApplication($app); |
109 | 109 | return $Strategy; |
110 | 110 | }; |
111 | 111 | |
112 | - $app['eccube.calculate.strategy.tax'] = function () use ($app) { |
|
112 | + $app['eccube.calculate.strategy.tax'] = function() use ($app) { |
|
113 | 113 | $Strategy = new \Eccube\Service\Calculator\Strategy\TaxStrategy(); |
114 | 114 | $Strategy->setApplication($app); |
115 | 115 | return $Strategy; |
116 | 116 | }; |
117 | 117 | |
118 | - $app['eccube.calculate.strategy.calculate_delivery_fee'] = function () use ($app) { |
|
118 | + $app['eccube.calculate.strategy.calculate_delivery_fee'] = function() use ($app) { |
|
119 | 119 | $Strategy = new \Eccube\Service\Calculator\Strategy\CalculateDeliveryFeeStrategy(); |
120 | 120 | $Strategy->setApplication($app); |
121 | 121 | return $Strategy; |
122 | 122 | }; |
123 | - $app['eccube.calculate.strategy.calculate_charge'] = function () use ($app) { |
|
123 | + $app['eccube.calculate.strategy.calculate_charge'] = function() use ($app) { |
|
124 | 124 | $Strategy = new \Eccube\Service\Calculator\Strategy\CalculateChargeStrategy(); |
125 | 125 | $Strategy->setApplication($app); |
126 | 126 | return $Strategy; |
127 | 127 | }; |
128 | - $app['eccube.calculate.strategy.calculate_total'] = function () use ($app) { |
|
128 | + $app['eccube.calculate.strategy.calculate_total'] = function() use ($app) { |
|
129 | 129 | $Strategy = new \Eccube\Service\Calculator\Strategy\CalculateTotalStrategy(); |
130 | 130 | $Strategy->setApplication($app); |
131 | 131 | return $Strategy; |
132 | 132 | }; |
133 | 133 | |
134 | - $app['payment.method'] = $app->protect(function ($clazz, $form) use ($app) { |
|
134 | + $app['payment.method'] = $app->protect(function($clazz, $form) use ($app) { |
|
135 | 135 | $PaymentMethod = new $clazz; |
136 | 136 | $PaymentMethod->setApplication($app); |
137 | 137 | $PaymentMethod->setFormType($form); |
138 | 138 | return $PaymentMethod; |
139 | 139 | }); |
140 | 140 | |
141 | - $app['payment.method.request'] = $app->protect(function ($clazz, $form, $request) use ($app) { |
|
141 | + $app['payment.method.request'] = $app->protect(function($clazz, $form, $request) use ($app) { |
|
142 | 142 | $PaymentMethod = new $clazz; |
143 | 143 | $PaymentMethod->setApplication($app); |
144 | 144 | $PaymentMethod->setFormType($form); |
@@ -146,11 +146,11 @@ discard block |
||
146 | 146 | return $PaymentMethod; |
147 | 147 | }); |
148 | 148 | |
149 | - $app['eccube.helper.order'] = function ($app) { |
|
149 | + $app['eccube.helper.order'] = function($app) { |
|
150 | 150 | return new OrderHelper($app); |
151 | 151 | }; |
152 | 152 | |
153 | - $app['eccube.service.csv.export'] = function () use ($app) { |
|
153 | + $app['eccube.service.csv.export'] = function() use ($app) { |
|
154 | 154 | $csvService = new \Eccube\Service\CsvExportService(); |
155 | 155 | $csvService->setEntityManager($app['orm.em']); |
156 | 156 | $csvService->setConfig($app['config']); |
@@ -162,206 +162,206 @@ discard block |
||
162 | 162 | |
163 | 163 | return $csvService; |
164 | 164 | }; |
165 | - $app['eccube.service.shopping'] = function () use ($app) { |
|
165 | + $app['eccube.service.shopping'] = function() use ($app) { |
|
166 | 166 | return new \Eccube\Service\ShoppingService($app, $app['eccube.service.cart'], $app['eccube.service.order']); |
167 | 167 | }; |
168 | 168 | |
169 | 169 | // Repository |
170 | - $app['eccube.repository.master.authority'] = function () use ($app) { |
|
170 | + $app['eccube.repository.master.authority'] = function() use ($app) { |
|
171 | 171 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Authority'); |
172 | 172 | }; |
173 | - $app['eccube.repository.master.tag'] = function () use ($app) { |
|
173 | + $app['eccube.repository.master.tag'] = function() use ($app) { |
|
174 | 174 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Tag'); |
175 | 175 | }; |
176 | - $app['eccube.repository.master.pref'] = function () use ($app) { |
|
176 | + $app['eccube.repository.master.pref'] = function() use ($app) { |
|
177 | 177 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Pref'); |
178 | 178 | }; |
179 | - $app['eccube.repository.master.sex'] = function () use ($app) { |
|
179 | + $app['eccube.repository.master.sex'] = function() use ($app) { |
|
180 | 180 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Sex'); |
181 | 181 | }; |
182 | - $app['eccube.repository.master.disp'] = function () use ($app) { |
|
182 | + $app['eccube.repository.master.disp'] = function() use ($app) { |
|
183 | 183 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Disp'); |
184 | 184 | }; |
185 | - $app['eccube.repository.master.product_type'] = function () use ($app) { |
|
185 | + $app['eccube.repository.master.product_type'] = function() use ($app) { |
|
186 | 186 | return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductType'); |
187 | 187 | }; |
188 | - $app['eccube.repository.master.page_max'] = function () use ($app) { |
|
188 | + $app['eccube.repository.master.page_max'] = function() use ($app) { |
|
189 | 189 | return $app['orm.em']->getRepository('Eccube\Entity\Master\PageMax'); |
190 | 190 | }; |
191 | - $app['eccube.repository.master.order_status'] = function () use ($app) { |
|
191 | + $app['eccube.repository.master.order_status'] = function() use ($app) { |
|
192 | 192 | }; |
193 | - $app['eccube.repository.master.product_list_max'] = function () use ($app) { |
|
193 | + $app['eccube.repository.master.product_list_max'] = function() use ($app) { |
|
194 | 194 | return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductListMax'); |
195 | 195 | }; |
196 | - $app['eccube.repository.master.product_list_order_by'] = function () use ($app) { |
|
196 | + $app['eccube.repository.master.product_list_order_by'] = function() use ($app) { |
|
197 | 197 | return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductListOrderBy'); |
198 | 198 | }; |
199 | - $app['eccube.repository.master.order_status'] = function () use ($app) { |
|
199 | + $app['eccube.repository.master.order_status'] = function() use ($app) { |
|
200 | 200 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus'); |
201 | 201 | }; |
202 | - $app['eccube.repository.master.device_type'] = function () use ($app) { |
|
202 | + $app['eccube.repository.master.device_type'] = function() use ($app) { |
|
203 | 203 | return $app['orm.em']->getRepository('Eccube\Entity\Master\DeviceType'); |
204 | 204 | }; |
205 | - $app['eccube.repository.master.csv_type'] = function () use ($app) { |
|
205 | + $app['eccube.repository.master.csv_type'] = function() use ($app) { |
|
206 | 206 | return $app['orm.em']->getRepository('Eccube\Entity\Master\CsvType'); |
207 | 207 | }; |
208 | - $app['eccube.repository.master.order_item_type'] = function () use ($app) { |
|
208 | + $app['eccube.repository.master.order_item_type'] = function() use ($app) { |
|
209 | 209 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderItemType'); |
210 | 210 | }; |
211 | 211 | |
212 | - $app['eccube.repository.delivery'] = function () use ($app) { |
|
212 | + $app['eccube.repository.delivery'] = function() use ($app) { |
|
213 | 213 | return $app['orm.em']->getRepository('Eccube\Entity\Delivery'); |
214 | 214 | }; |
215 | - $app['eccube.repository.delivery_date'] = function () use ($app) { |
|
215 | + $app['eccube.repository.delivery_date'] = function() use ($app) { |
|
216 | 216 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryDate'); |
217 | 217 | }; |
218 | - $app['eccube.repository.delivery_fee'] = function () use ($app) { |
|
218 | + $app['eccube.repository.delivery_fee'] = function() use ($app) { |
|
219 | 219 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryFee'); |
220 | 220 | }; |
221 | - $app['eccube.repository.delivery_time'] = function () use ($app) { |
|
221 | + $app['eccube.repository.delivery_time'] = function() use ($app) { |
|
222 | 222 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryTime'); |
223 | 223 | }; |
224 | - $app['eccube.repository.payment'] = function () use ($app) { |
|
224 | + $app['eccube.repository.payment'] = function() use ($app) { |
|
225 | 225 | return $app['orm.em']->getRepository('Eccube\Entity\Payment'); |
226 | 226 | }; |
227 | - $app['eccube.repository.payment_option'] = function () use ($app) { |
|
227 | + $app['eccube.repository.payment_option'] = function() use ($app) { |
|
228 | 228 | return $app['orm.em']->getRepository('Eccube\Entity\PaymentOption'); |
229 | 229 | }; |
230 | - $app['eccube.repository.category'] = function () use ($app) { |
|
230 | + $app['eccube.repository.category'] = function() use ($app) { |
|
231 | 231 | $CategoryRepository = $app['orm.em']->getRepository('Eccube\Entity\Category'); |
232 | 232 | $CategoryRepository->setApplication($app); |
233 | 233 | |
234 | 234 | return $CategoryRepository; |
235 | 235 | }; |
236 | - $app['eccube.repository.customer'] = function () use ($app) { |
|
236 | + $app['eccube.repository.customer'] = function() use ($app) { |
|
237 | 237 | $customerRepository = $app['orm.em']->getRepository('Eccube\Entity\Customer'); |
238 | 238 | $customerRepository->setApplication($app); |
239 | 239 | return $customerRepository; |
240 | 240 | }; |
241 | - $app['eccube.repository.news'] = function () use ($app) { |
|
241 | + $app['eccube.repository.news'] = function() use ($app) { |
|
242 | 242 | return $app['orm.em']->getRepository('Eccube\Entity\News'); |
243 | 243 | }; |
244 | - $app['eccube.repository.mail_history'] = function () use ($app) { |
|
244 | + $app['eccube.repository.mail_history'] = function() use ($app) { |
|
245 | 245 | return $app['orm.em']->getRepository('Eccube\Entity\MailHistory'); |
246 | 246 | }; |
247 | - $app['eccube.repository.member'] = function () use ($app) { |
|
247 | + $app['eccube.repository.member'] = function() use ($app) { |
|
248 | 248 | $memberRepository = $app['orm.em']->getRepository('Eccube\Entity\Member'); |
249 | 249 | $memberRepository->setEncoderFactorty($app['security.encoder_factory']); |
250 | 250 | return $memberRepository; |
251 | 251 | }; |
252 | - $app['eccube.repository.order'] = function () use ($app) { |
|
252 | + $app['eccube.repository.order'] = function() use ($app) { |
|
253 | 253 | return $app['orm.em']->getRepository('Eccube\Entity\Order'); |
254 | 254 | }; |
255 | - $app['eccube.repository.product'] = function () use ($app) { |
|
255 | + $app['eccube.repository.product'] = function() use ($app) { |
|
256 | 256 | $productRepository = $app['orm.em']->getRepository('Eccube\Entity\Product'); |
257 | 257 | $productRepository->setApplication($app); |
258 | 258 | |
259 | 259 | return $productRepository; |
260 | 260 | }; |
261 | - $app['eccube.repository.product_image'] = function () use ($app) { |
|
261 | + $app['eccube.repository.product_image'] = function() use ($app) { |
|
262 | 262 | return $app['orm.em']->getRepository('Eccube\Entity\ProductImage'); |
263 | 263 | }; |
264 | - $app['eccube.repository.product_class'] = function () use ($app) { |
|
264 | + $app['eccube.repository.product_class'] = function() use ($app) { |
|
265 | 265 | return $app['orm.em']->getRepository('Eccube\Entity\ProductClass'); |
266 | 266 | }; |
267 | - $app['eccube.repository.product_stock'] = function () use ($app) { |
|
267 | + $app['eccube.repository.product_stock'] = function() use ($app) { |
|
268 | 268 | return $app['orm.em']->getRepository('Eccube\Entity\ProductStock'); |
269 | 269 | }; |
270 | - $app['eccube.repository.product_tag'] = function () use ($app) { |
|
270 | + $app['eccube.repository.product_tag'] = function() use ($app) { |
|
271 | 271 | return $app['orm.em']->getRepository('Eccube\Entity\ProductTag'); |
272 | 272 | }; |
273 | - $app['eccube.repository.class_name'] = function () use ($app) { |
|
273 | + $app['eccube.repository.class_name'] = function() use ($app) { |
|
274 | 274 | return $app['orm.em']->getRepository('Eccube\Entity\ClassName'); |
275 | 275 | }; |
276 | - $app['eccube.repository.class_category'] = function () use ($app) { |
|
276 | + $app['eccube.repository.class_category'] = function() use ($app) { |
|
277 | 277 | return $app['orm.em']->getRepository('Eccube\Entity\ClassCategory'); |
278 | 278 | }; |
279 | - $app['eccube.repository.customer_favorite_product'] = function () use ($app) { |
|
279 | + $app['eccube.repository.customer_favorite_product'] = function() use ($app) { |
|
280 | 280 | return $app['orm.em']->getRepository('Eccube\Entity\CustomerFavoriteProduct'); |
281 | 281 | }; |
282 | - $app['eccube.repository.base_info'] = function () use ($app) { |
|
282 | + $app['eccube.repository.base_info'] = function() use ($app) { |
|
283 | 283 | $BaseInfoRepository = $app['orm.em']->getRepository('Eccube\Entity\BaseInfo'); |
284 | 284 | $BaseInfoRepository->setApplication($app); |
285 | 285 | |
286 | 286 | return $BaseInfoRepository; |
287 | 287 | }; |
288 | - $app['eccube.repository.tax_rule'] = function () use ($app) { |
|
288 | + $app['eccube.repository.tax_rule'] = function() use ($app) { |
|
289 | 289 | $taxRuleRepository = $app['orm.em']->getRepository('Eccube\Entity\TaxRule'); |
290 | 290 | $taxRuleRepository->setApplication($app); |
291 | 291 | |
292 | 292 | return $taxRuleRepository; |
293 | 293 | }; |
294 | - $app['eccube.repository.page_layout'] = function () use ($app) { |
|
294 | + $app['eccube.repository.page_layout'] = function() use ($app) { |
|
295 | 295 | $pageLayoutRepository = $app['orm.em']->getRepository('Eccube\Entity\PageLayout'); |
296 | 296 | $pageLayoutRepository->setApplication($app); |
297 | 297 | |
298 | 298 | return $pageLayoutRepository; |
299 | 299 | }; |
300 | - $app['eccube.repository.block'] = function () use ($app) { |
|
300 | + $app['eccube.repository.block'] = function() use ($app) { |
|
301 | 301 | $blockRepository = $app['orm.em']->getRepository('Eccube\Entity\Block'); |
302 | 302 | $blockRepository->setApplication($app); |
303 | 303 | |
304 | 304 | return $blockRepository; |
305 | 305 | }; |
306 | - $app['eccube.repository.order'] = function () use ($app) { |
|
306 | + $app['eccube.repository.order'] = function() use ($app) { |
|
307 | 307 | $orderRepository = $app['orm.em']->getRepository('Eccube\Entity\Order'); |
308 | 308 | $orderRepository->setApplication($app); |
309 | 309 | |
310 | 310 | return $orderRepository; |
311 | 311 | }; |
312 | - $app['eccube.repository.customer_address'] = function () use ($app) { |
|
312 | + $app['eccube.repository.customer_address'] = function() use ($app) { |
|
313 | 313 | return $app['orm.em']->getRepository('Eccube\Entity\CustomerAddress'); |
314 | 314 | }; |
315 | - $app['eccube.repository.shipping'] = function () use ($app) { |
|
315 | + $app['eccube.repository.shipping'] = function() use ($app) { |
|
316 | 316 | return $app['orm.em']->getRepository('Eccube\Entity\Shipping'); |
317 | 317 | }; |
318 | - $app['eccube.repository.shipment_item'] = function () use ($app) { |
|
318 | + $app['eccube.repository.shipment_item'] = function() use ($app) { |
|
319 | 319 | return $app['orm.em']->getRepository('Eccube\Entity\ShipmentItem'); |
320 | 320 | }; |
321 | - $app['eccube.repository.customer_status'] = function () use ($app) { |
|
321 | + $app['eccube.repository.customer_status'] = function() use ($app) { |
|
322 | 322 | return $app['orm.em']->getRepository('Eccube\Entity\Master\CustomerStatus'); |
323 | 323 | }; |
324 | - $app['eccube.repository.order_status'] = function () use ($app) { |
|
324 | + $app['eccube.repository.order_status'] = function() use ($app) { |
|
325 | 325 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus'); |
326 | 326 | }; |
327 | - $app['eccube.repository.mail_template'] = function () use ($app) { |
|
327 | + $app['eccube.repository.mail_template'] = function() use ($app) { |
|
328 | 328 | return $app['orm.em']->getRepository('Eccube\Entity\MailTemplate'); |
329 | 329 | }; |
330 | - $app['eccube.repository.csv'] = function () use ($app) { |
|
330 | + $app['eccube.repository.csv'] = function() use ($app) { |
|
331 | 331 | return $app['orm.em']->getRepository('Eccube\Entity\Csv'); |
332 | 332 | }; |
333 | - $app['eccube.repository.template'] = function () use ($app) { |
|
333 | + $app['eccube.repository.template'] = function() use ($app) { |
|
334 | 334 | return $app['orm.em']->getRepository('Eccube\Entity\Template'); |
335 | 335 | }; |
336 | - $app['eccube.repository.authority_role'] = function () use ($app) { |
|
336 | + $app['eccube.repository.authority_role'] = function() use ($app) { |
|
337 | 337 | return $app['orm.em']->getRepository('Eccube\Entity\AuthorityRole'); |
338 | 338 | }; |
339 | 339 | |
340 | - $app['paginator'] = $app->protect(function () { |
|
340 | + $app['paginator'] = $app->protect(function() { |
|
341 | 341 | $paginator = new \Knp\Component\Pager\Paginator(); |
342 | 342 | $paginator->subscribe(new \Eccube\EventListener\PaginatorListener()); |
343 | 343 | |
344 | 344 | return $paginator; |
345 | 345 | }); |
346 | 346 | |
347 | - $app['eccube.repository.help'] = function () use ($app) { |
|
347 | + $app['eccube.repository.help'] = function() use ($app) { |
|
348 | 348 | return $app['orm.em']->getRepository('Eccube\Entity\Help'); |
349 | 349 | }; |
350 | - $app['eccube.repository.plugin'] = function () use ($app) { |
|
350 | + $app['eccube.repository.plugin'] = function() use ($app) { |
|
351 | 351 | return $app['orm.em']->getRepository('Eccube\Entity\Plugin'); |
352 | 352 | }; |
353 | - $app['eccube.repository.plugin_event_handler'] = function () use ($app) { |
|
353 | + $app['eccube.repository.plugin_event_handler'] = function() use ($app) { |
|
354 | 354 | return $app['orm.em']->getRepository('Eccube\Entity\PluginEventHandler'); |
355 | 355 | }; |
356 | - $app['eccube.repository.layout'] = function () use ($app) { |
|
356 | + $app['eccube.repository.layout'] = function() use ($app) { |
|
357 | 357 | return $app['orm.em']->getRepository('Eccube\Entity\Layout'); |
358 | 358 | }; |
359 | 359 | |
360 | - $app['request_scope'] = function () { |
|
360 | + $app['request_scope'] = function() { |
|
361 | 361 | return new ParameterBag(); |
362 | 362 | }; |
363 | 363 | // TODO 使用するか検討 |
364 | - $app['eccube.twig.node.hello'] = $app->protect(function ($node, $compiler) { |
|
364 | + $app['eccube.twig.node.hello'] = $app->protect(function($node, $compiler) { |
|
365 | 365 | $compiler |
366 | 366 | ->addDebugInfo($node) |
367 | 367 | ->write("echo 'Helloooooo ' . ") |
@@ -371,7 +371,7 @@ discard block |
||
371 | 371 | |
372 | 372 | }); |
373 | 373 | // TODO 使用するか検討 |
374 | - $app['eccube.twig.node.jiro'] = $app->protect(function ($node, $compiler) { |
|
374 | + $app['eccube.twig.node.jiro'] = $app->protect(function($node, $compiler) { |
|
375 | 375 | $compiler |
376 | 376 | ->addDebugInfo($node) |
377 | 377 | ->write("echo 'jirooooooo ' . ") |
@@ -382,7 +382,7 @@ discard block |
||
382 | 382 | }); |
383 | 383 | |
384 | 384 | // TODO 使用するか検討 |
385 | - $app['eccube.twig.generic_node_names'] = function () use ($app) { |
|
385 | + $app['eccube.twig.generic_node_names'] = function() use ($app) { |
|
386 | 386 | return [ |
387 | 387 | 'hello', |
388 | 388 | 'jiro', |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | }; |
392 | 392 | |
393 | 393 | // TODO 使用するか検討 |
394 | - $app['twig_parsers'] = function () use ($app) { |
|
394 | + $app['twig_parsers'] = function() use ($app) { |
|
395 | 395 | $GenericTokenParsers = []; |
396 | 396 | foreach ($app['eccube.twig.generic_node_names'] as $tagName) { |
397 | 397 | $GenericTokenParsers[] = new \Eccube\Twig\Extension\GenericTokenParser($app, $tagName); |
@@ -400,20 +400,20 @@ discard block |
||
400 | 400 | }; |
401 | 401 | |
402 | 402 | // TODO ServiceProvider から追加できるよう Collection にする |
403 | - $app['eccube.twig.block.templates'] = function () { |
|
403 | + $app['eccube.twig.block.templates'] = function() { |
|
404 | 404 | return [ |
405 | 405 | 'render_block.twig', |
406 | 406 | ]; |
407 | 407 | }; |
408 | 408 | |
409 | 409 | // Form\Type |
410 | - $app->extend('form.type.extensions', function ($extensions) use ($app) { |
|
410 | + $app->extend('form.type.extensions', function($extensions) use ($app) { |
|
411 | 411 | $extensions[] = new \Eccube\Form\Extension\HelpTypeExtension(); |
412 | 412 | $extensions[] = new \Eccube\Form\Extension\FreezeTypeExtension(); |
413 | 413 | $extensions[] = new \Eccube\Form\Extension\DoctrineOrmExtension($app['orm.em']); |
414 | 414 | return $extensions; |
415 | 415 | }); |
416 | - $app->extend('form.types', function ($types) use ($app) { |
|
416 | + $app->extend('form.types', function($types) use ($app) { |
|
417 | 417 | $types[] = new \Eccube\Form\Type\NameType($app['config']); |
418 | 418 | $types[] = new \Eccube\Form\Type\KanaType($app['config']); |
419 | 419 | $types[] = new \Eccube\Form\Type\TelType($app['config']); |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | return $types; |
518 | 518 | }); |
519 | 519 | $app['eccube.entity.event.dispatcher']->addEventListener(new \Acme\Entity\SoldOutEventListener()); |
520 | - $app['eccube.queries'] = function () { |
|
520 | + $app['eccube.queries'] = function() { |
|
521 | 521 | return new \Eccube\Doctrine\Query\Queries(); |
522 | 522 | }; |
523 | 523 | // TODO QueryCustomizerの追加方法は要検討 |
@@ -40,14 +40,14 @@ |
||
40 | 40 | $eventName = $view; |
41 | 41 | if ($this->isAdminRequest()) { |
42 | 42 | // 管理画面の場合、event名に「Admin/」を付ける |
43 | - $eventName = 'Admin/' . $view; |
|
43 | + $eventName = 'Admin/'.$view; |
|
44 | 44 | } |
45 | - $this['monolog']->debug('Template Event Name : ' . $eventName); |
|
45 | + $this['monolog']->debug('Template Event Name : '.$eventName); |
|
46 | 46 | |
47 | 47 | // $this['eccube.event.dispatcher']->dispatch($eventName, $event); |
48 | 48 | |
49 | 49 | if ($response instanceof StreamedResponse) { |
50 | - $response->setCallback(function () use ($twig, $view, $parameters) { |
|
50 | + $response->setCallback(function() use ($twig, $view, $parameters) { |
|
51 | 51 | $twig->display($view, $parameters); |
52 | 52 | }); |
53 | 53 | } else { |
@@ -22,17 +22,17 @@ discard block |
||
22 | 22 | $app->register(new \Silex\Provider\MonologServiceProvider()); |
23 | 23 | |
24 | 24 | // Log |
25 | - $app['eccube.logger'] = function ($app) { |
|
25 | + $app['eccube.logger'] = function($app) { |
|
26 | 26 | return new Logger($app); |
27 | 27 | }; |
28 | 28 | |
29 | 29 | // ヘルパー作成 |
30 | - $app['eccube.monolog.helper'] = function ($app) { |
|
30 | + $app['eccube.monolog.helper'] = function($app) { |
|
31 | 31 | return new LogHelper($app); |
32 | 32 | }; |
33 | 33 | |
34 | 34 | // ログクラス作成ファクトリー |
35 | - $app['eccube.monolog.factory'] = $app->protect(function (array $channelValues) use ($app) { |
|
35 | + $app['eccube.monolog.factory'] = $app->protect(function(array $channelValues) use ($app) { |
|
36 | 36 | |
37 | 37 | $log = new $app['monolog.logger.class']($channelValues['name']); |
38 | 38 | |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | // monologの設定は除外 |
48 | 48 | unset($channels['monolog']); |
49 | 49 | foreach ($channels as $channel => $channelValues) { |
50 | - $app['monolog.logger.'.$channel] = function ($app) use ($channelValues) { |
|
50 | + $app['monolog.logger.'.$channel] = function($app) use ($channelValues) { |
|
51 | 51 | return $app['eccube.monolog.factory']($channelValues); |
52 | 52 | }; |
53 | 53 | } |
@@ -55,15 +55,15 @@ discard block |
||
55 | 55 | // MonologServiceProviderで定義されているmonolog.handlerの置換 |
56 | 56 | $channelValues = $app['config']['log']['channel']['monolog']; |
57 | 57 | $app['monolog.name'] = $channelValues['name']; |
58 | - $app['monolog.handler'] = function ($app) use ($channelValues) { |
|
58 | + $app['monolog.handler'] = function($app) use ($channelValues) { |
|
59 | 59 | return $app['eccube.monolog.helper']->getHandler($channelValues); |
60 | 60 | }; |
61 | 61 | |
62 | - $app['eccube.monolog.listener'] = function () use ($app) { |
|
62 | + $app['eccube.monolog.listener'] = function() use ($app) { |
|
63 | 63 | return new LogListener($app['eccube.logger']); |
64 | 64 | }; |
65 | 65 | |
66 | - $app['listener.requestdump'] = function ($app) { |
|
66 | + $app['listener.requestdump'] = function($app) { |
|
67 | 67 | return new \Eccube\EventListener\RequestDumpListener($app); |
68 | 68 | }; |
69 | 69 | } |