@@ -16,7 +16,7 @@ |
||
16 | 16 | return new \Mobile_Detect(); |
17 | 17 | }; |
18 | 18 | |
19 | - $app['mobile_detect.device_type'] = function ($app) { |
|
19 | + $app['mobile_detect.device_type'] = function($app) { |
|
20 | 20 | if ($app['mobile_detect']->isMobile()) { |
21 | 21 | return \Eccube\Entity\Master\DeviceType::DEVICE_TYPE_SP; |
22 | 22 | } else { |
@@ -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 | $Context->setCalculateStrategies($app['eccube.calculate.strategies']($Order)); |
@@ -78,40 +78,40 @@ discard block |
||
78 | 78 | return $Service; |
79 | 79 | }); |
80 | 80 | |
81 | - $app['eccube.service.payment'] = $app->protect(function ($clazz) use ($app) { |
|
81 | + $app['eccube.service.payment'] = $app->protect(function($clazz) use ($app) { |
|
82 | 82 | $Service = new $clazz; |
83 | 83 | $Service->setApplication($app); |
84 | 84 | return $Service; |
85 | 85 | }); |
86 | 86 | |
87 | - $app['eccube.calculate.strategies'] = $app->protect(function ($Order) use ($app) { |
|
87 | + $app['eccube.calculate.strategies'] = $app->protect(function($Order) use ($app) { |
|
88 | 88 | $Strategies = new \Doctrine\Common\Collections\ArrayCollection(); // TODO 暫定的に ArrayCollection とする. 専用クラスにしたい |
89 | 89 | // デフォルトのストラテジーをセットしておく |
90 | 90 | $Strategies->add($app['eccube.calculate.strategy.shipping']($Order)); |
91 | 91 | $Strategies->add($app['eccube.calculate.strategy.tax']($Order)); |
92 | 92 | return $Strategies; |
93 | 93 | }); |
94 | - $app['eccube.calculate.strategy.shipping'] = $app->protect(function ($Order) use ($app) { |
|
94 | + $app['eccube.calculate.strategy.shipping'] = $app->protect(function($Order) use ($app) { |
|
95 | 95 | $Strategy = new \Eccube\Service\Calculator\Strategy\ShippingStrategy(); |
96 | 96 | $Strategy->setApplication($app); |
97 | 97 | $Strategy->setOrder($Order); |
98 | 98 | return $Strategy; |
99 | 99 | }); |
100 | - $app['eccube.calculate.strategy.tax'] = $app->protect(function ($Order) use ($app) { |
|
100 | + $app['eccube.calculate.strategy.tax'] = $app->protect(function($Order) use ($app) { |
|
101 | 101 | $Strategy = new \Eccube\Service\Calculator\Strategy\TaxStrategy(); |
102 | 102 | $Strategy->setApplication($app); |
103 | 103 | $Strategy->setOrder($Order); |
104 | 104 | return $Strategy; |
105 | 105 | }); |
106 | 106 | |
107 | - $app['payment.method'] = $app->protect(function ($clazz, $form) use ($app) { |
|
107 | + $app['payment.method'] = $app->protect(function($clazz, $form) use ($app) { |
|
108 | 108 | $PaymentMethod = new $clazz; |
109 | 109 | $PaymentMethod->setApplication($app); |
110 | 110 | $PaymentMethod->setFormType($form); |
111 | 111 | return $PaymentMethod; |
112 | 112 | }); |
113 | 113 | |
114 | - $app['payment.method.request'] = $app->protect(function ($clazz, $form, $request) use ($app) { |
|
114 | + $app['payment.method.request'] = $app->protect(function($clazz, $form, $request) use ($app) { |
|
115 | 115 | $PaymentMethod = new $clazz; |
116 | 116 | $PaymentMethod->setApplication($app); |
117 | 117 | $PaymentMethod->setFormType($form); |
@@ -119,11 +119,11 @@ discard block |
||
119 | 119 | return $PaymentMethod; |
120 | 120 | }); |
121 | 121 | |
122 | - $app['eccube.helper.order'] = function ($app) { |
|
122 | + $app['eccube.helper.order'] = function($app) { |
|
123 | 123 | return new OrderHelper($app); |
124 | 124 | }; |
125 | 125 | |
126 | - $app['eccube.service.csv.export'] = function () use ($app) { |
|
126 | + $app['eccube.service.csv.export'] = function() use ($app) { |
|
127 | 127 | $csvService = new \Eccube\Service\CsvExportService(); |
128 | 128 | $csvService->setEntityManager($app['orm.em']); |
129 | 129 | $csvService->setConfig($app['config']); |
@@ -135,200 +135,200 @@ discard block |
||
135 | 135 | |
136 | 136 | return $csvService; |
137 | 137 | }; |
138 | - $app['eccube.service.shopping'] = function () use ($app) { |
|
138 | + $app['eccube.service.shopping'] = function() use ($app) { |
|
139 | 139 | return new \Eccube\Service\ShoppingService($app, $app['eccube.service.cart'], $app['eccube.service.order']); |
140 | 140 | }; |
141 | 141 | |
142 | 142 | // Repository |
143 | - $app['eccube.repository.master.authority'] = function () use ($app) { |
|
143 | + $app['eccube.repository.master.authority'] = function() use ($app) { |
|
144 | 144 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Authority'); |
145 | 145 | }; |
146 | - $app['eccube.repository.master.tag'] = function () use ($app) { |
|
146 | + $app['eccube.repository.master.tag'] = function() use ($app) { |
|
147 | 147 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Tag'); |
148 | 148 | }; |
149 | - $app['eccube.repository.master.pref'] = function () use ($app) { |
|
149 | + $app['eccube.repository.master.pref'] = function() use ($app) { |
|
150 | 150 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Pref'); |
151 | 151 | }; |
152 | - $app['eccube.repository.master.sex'] = function () use ($app) { |
|
152 | + $app['eccube.repository.master.sex'] = function() use ($app) { |
|
153 | 153 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Sex'); |
154 | 154 | }; |
155 | - $app['eccube.repository.master.disp'] = function () use ($app) { |
|
155 | + $app['eccube.repository.master.disp'] = function() use ($app) { |
|
156 | 156 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Disp'); |
157 | 157 | }; |
158 | - $app['eccube.repository.master.product_type'] = function () use ($app) { |
|
158 | + $app['eccube.repository.master.product_type'] = function() use ($app) { |
|
159 | 159 | return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductType'); |
160 | 160 | }; |
161 | - $app['eccube.repository.master.page_max'] = function () use ($app) { |
|
161 | + $app['eccube.repository.master.page_max'] = function() use ($app) { |
|
162 | 162 | return $app['orm.em']->getRepository('Eccube\Entity\Master\PageMax'); |
163 | 163 | }; |
164 | - $app['eccube.repository.master.order_status'] = function () use ($app) { |
|
164 | + $app['eccube.repository.master.order_status'] = function() use ($app) { |
|
165 | 165 | }; |
166 | - $app['eccube.repository.master.product_list_max'] = function () use ($app) { |
|
166 | + $app['eccube.repository.master.product_list_max'] = function() use ($app) { |
|
167 | 167 | return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductListMax'); |
168 | 168 | }; |
169 | - $app['eccube.repository.master.product_list_order_by'] = function () use ($app) { |
|
169 | + $app['eccube.repository.master.product_list_order_by'] = function() use ($app) { |
|
170 | 170 | return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductListOrderBy'); |
171 | 171 | }; |
172 | - $app['eccube.repository.master.order_status'] = function () use ($app) { |
|
172 | + $app['eccube.repository.master.order_status'] = function() use ($app) { |
|
173 | 173 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus'); |
174 | 174 | }; |
175 | - $app['eccube.repository.master.device_type'] = function () use ($app) { |
|
175 | + $app['eccube.repository.master.device_type'] = function() use ($app) { |
|
176 | 176 | return $app['orm.em']->getRepository('Eccube\Entity\Master\DeviceType'); |
177 | 177 | }; |
178 | - $app['eccube.repository.master.csv_type'] = function () use ($app) { |
|
178 | + $app['eccube.repository.master.csv_type'] = function() use ($app) { |
|
179 | 179 | return $app['orm.em']->getRepository('Eccube\Entity\Master\CsvType'); |
180 | 180 | }; |
181 | 181 | |
182 | - $app['eccube.repository.delivery'] = function () use ($app) { |
|
182 | + $app['eccube.repository.delivery'] = function() use ($app) { |
|
183 | 183 | return $app['orm.em']->getRepository('Eccube\Entity\Delivery'); |
184 | 184 | }; |
185 | - $app['eccube.repository.delivery_date'] = function () use ($app) { |
|
185 | + $app['eccube.repository.delivery_date'] = function() use ($app) { |
|
186 | 186 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryDate'); |
187 | 187 | }; |
188 | - $app['eccube.repository.delivery_fee'] = function () use ($app) { |
|
188 | + $app['eccube.repository.delivery_fee'] = function() use ($app) { |
|
189 | 189 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryFee'); |
190 | 190 | }; |
191 | - $app['eccube.repository.delivery_time'] = function () use ($app) { |
|
191 | + $app['eccube.repository.delivery_time'] = function() use ($app) { |
|
192 | 192 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryTime'); |
193 | 193 | }; |
194 | - $app['eccube.repository.payment'] = function () use ($app) { |
|
194 | + $app['eccube.repository.payment'] = function() use ($app) { |
|
195 | 195 | return $app['orm.em']->getRepository('Eccube\Entity\Payment'); |
196 | 196 | }; |
197 | - $app['eccube.repository.payment_option'] = function () use ($app) { |
|
197 | + $app['eccube.repository.payment_option'] = function() use ($app) { |
|
198 | 198 | return $app['orm.em']->getRepository('Eccube\Entity\PaymentOption'); |
199 | 199 | }; |
200 | - $app['eccube.repository.category'] = function () use ($app) { |
|
200 | + $app['eccube.repository.category'] = function() use ($app) { |
|
201 | 201 | $CategoryRepository = $app['orm.em']->getRepository('Eccube\Entity\Category'); |
202 | 202 | $CategoryRepository->setApplication($app); |
203 | 203 | |
204 | 204 | return $CategoryRepository; |
205 | 205 | }; |
206 | - $app['eccube.repository.customer'] = function () use ($app) { |
|
206 | + $app['eccube.repository.customer'] = function() use ($app) { |
|
207 | 207 | $customerRepository = $app['orm.em']->getRepository('Eccube\Entity\Customer'); |
208 | 208 | $customerRepository->setApplication($app); |
209 | 209 | return $customerRepository; |
210 | 210 | }; |
211 | - $app['eccube.repository.news'] = function () use ($app) { |
|
211 | + $app['eccube.repository.news'] = function() use ($app) { |
|
212 | 212 | return $app['orm.em']->getRepository('Eccube\Entity\News'); |
213 | 213 | }; |
214 | - $app['eccube.repository.mail_history'] = function () use ($app) { |
|
214 | + $app['eccube.repository.mail_history'] = function() use ($app) { |
|
215 | 215 | return $app['orm.em']->getRepository('Eccube\Entity\MailHistory'); |
216 | 216 | }; |
217 | - $app['eccube.repository.member'] = function () use ($app) { |
|
217 | + $app['eccube.repository.member'] = function() use ($app) { |
|
218 | 218 | $memberRepository = $app['orm.em']->getRepository('Eccube\Entity\Member'); |
219 | 219 | $memberRepository->setEncoderFactorty($app['security.encoder_factory']); |
220 | 220 | return $memberRepository; |
221 | 221 | }; |
222 | - $app['eccube.repository.order'] = function () use ($app) { |
|
222 | + $app['eccube.repository.order'] = function() use ($app) { |
|
223 | 223 | return $app['orm.em']->getRepository('Eccube\Entity\Order'); |
224 | 224 | }; |
225 | - $app['eccube.repository.product'] = function () use ($app) { |
|
225 | + $app['eccube.repository.product'] = function() use ($app) { |
|
226 | 226 | $productRepository = $app['orm.em']->getRepository('Eccube\Entity\Product'); |
227 | 227 | $productRepository->setApplication($app); |
228 | 228 | |
229 | 229 | return $productRepository; |
230 | 230 | }; |
231 | - $app['eccube.repository.product_image'] = function () use ($app) { |
|
231 | + $app['eccube.repository.product_image'] = function() use ($app) { |
|
232 | 232 | return $app['orm.em']->getRepository('Eccube\Entity\ProductImage'); |
233 | 233 | }; |
234 | - $app['eccube.repository.product_class'] = function () use ($app) { |
|
234 | + $app['eccube.repository.product_class'] = function() use ($app) { |
|
235 | 235 | return $app['orm.em']->getRepository('Eccube\Entity\ProductClass'); |
236 | 236 | }; |
237 | - $app['eccube.repository.product_stock'] = function () use ($app) { |
|
237 | + $app['eccube.repository.product_stock'] = function() use ($app) { |
|
238 | 238 | return $app['orm.em']->getRepository('Eccube\Entity\ProductStock'); |
239 | 239 | }; |
240 | - $app['eccube.repository.product_tag'] = function () use ($app) { |
|
240 | + $app['eccube.repository.product_tag'] = function() use ($app) { |
|
241 | 241 | return $app['orm.em']->getRepository('Eccube\Entity\ProductTag'); |
242 | 242 | }; |
243 | - $app['eccube.repository.class_name'] = function () use ($app) { |
|
243 | + $app['eccube.repository.class_name'] = function() use ($app) { |
|
244 | 244 | return $app['orm.em']->getRepository('Eccube\Entity\ClassName'); |
245 | 245 | }; |
246 | - $app['eccube.repository.class_category'] = function () use ($app) { |
|
246 | + $app['eccube.repository.class_category'] = function() use ($app) { |
|
247 | 247 | return $app['orm.em']->getRepository('Eccube\Entity\ClassCategory'); |
248 | 248 | }; |
249 | - $app['eccube.repository.customer_favorite_product'] = function () use ($app) { |
|
249 | + $app['eccube.repository.customer_favorite_product'] = function() use ($app) { |
|
250 | 250 | return $app['orm.em']->getRepository('Eccube\Entity\CustomerFavoriteProduct'); |
251 | 251 | }; |
252 | - $app['eccube.repository.base_info'] = function () use ($app) { |
|
252 | + $app['eccube.repository.base_info'] = function() use ($app) { |
|
253 | 253 | $BaseInfoRepository = $app['orm.em']->getRepository('Eccube\Entity\BaseInfo'); |
254 | 254 | $BaseInfoRepository->setApplication($app); |
255 | 255 | |
256 | 256 | return $BaseInfoRepository; |
257 | 257 | }; |
258 | - $app['eccube.repository.tax_rule'] = function () use ($app) { |
|
258 | + $app['eccube.repository.tax_rule'] = function() use ($app) { |
|
259 | 259 | $taxRuleRepository = $app['orm.em']->getRepository('Eccube\Entity\TaxRule'); |
260 | 260 | $taxRuleRepository->setApplication($app); |
261 | 261 | |
262 | 262 | return $taxRuleRepository; |
263 | 263 | }; |
264 | - $app['eccube.repository.page_layout'] = function () use ($app) { |
|
264 | + $app['eccube.repository.page_layout'] = function() use ($app) { |
|
265 | 265 | $pageLayoutRepository = $app['orm.em']->getRepository('Eccube\Entity\PageLayout'); |
266 | 266 | $pageLayoutRepository->setApplication($app); |
267 | 267 | |
268 | 268 | return $pageLayoutRepository; |
269 | 269 | }; |
270 | - $app['eccube.repository.block'] = function () use ($app) { |
|
270 | + $app['eccube.repository.block'] = function() use ($app) { |
|
271 | 271 | $blockRepository = $app['orm.em']->getRepository('Eccube\Entity\Block'); |
272 | 272 | $blockRepository->setApplication($app); |
273 | 273 | |
274 | 274 | return $blockRepository; |
275 | 275 | }; |
276 | - $app['eccube.repository.order'] = function () use ($app) { |
|
276 | + $app['eccube.repository.order'] = function() use ($app) { |
|
277 | 277 | $orderRepository = $app['orm.em']->getRepository('Eccube\Entity\Order'); |
278 | 278 | $orderRepository->setApplication($app); |
279 | 279 | |
280 | 280 | return $orderRepository; |
281 | 281 | }; |
282 | - $app['eccube.repository.customer_address'] = function () use ($app) { |
|
282 | + $app['eccube.repository.customer_address'] = function() use ($app) { |
|
283 | 283 | return $app['orm.em']->getRepository('Eccube\Entity\CustomerAddress'); |
284 | 284 | }; |
285 | - $app['eccube.repository.shipping'] = function () use ($app) { |
|
285 | + $app['eccube.repository.shipping'] = function() use ($app) { |
|
286 | 286 | return $app['orm.em']->getRepository('Eccube\Entity\Shipping'); |
287 | 287 | }; |
288 | - $app['eccube.repository.customer_status'] = function () use ($app) { |
|
288 | + $app['eccube.repository.customer_status'] = function() use ($app) { |
|
289 | 289 | return $app['orm.em']->getRepository('Eccube\Entity\Master\CustomerStatus'); |
290 | 290 | }; |
291 | - $app['eccube.repository.order_status'] = function () use ($app) { |
|
291 | + $app['eccube.repository.order_status'] = function() use ($app) { |
|
292 | 292 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus'); |
293 | 293 | }; |
294 | - $app['eccube.repository.mail_template'] = function () use ($app) { |
|
294 | + $app['eccube.repository.mail_template'] = function() use ($app) { |
|
295 | 295 | return $app['orm.em']->getRepository('Eccube\Entity\MailTemplate'); |
296 | 296 | }; |
297 | - $app['eccube.repository.csv'] = function () use ($app) { |
|
297 | + $app['eccube.repository.csv'] = function() use ($app) { |
|
298 | 298 | return $app['orm.em']->getRepository('Eccube\Entity\Csv'); |
299 | 299 | }; |
300 | - $app['eccube.repository.template'] = function () use ($app) { |
|
300 | + $app['eccube.repository.template'] = function() use ($app) { |
|
301 | 301 | return $app['orm.em']->getRepository('Eccube\Entity\Template'); |
302 | 302 | }; |
303 | - $app['eccube.repository.authority_role'] = function () use ($app) { |
|
303 | + $app['eccube.repository.authority_role'] = function() use ($app) { |
|
304 | 304 | return $app['orm.em']->getRepository('Eccube\Entity\AuthorityRole'); |
305 | 305 | }; |
306 | 306 | |
307 | - $app['paginator'] = $app->protect(function () { |
|
307 | + $app['paginator'] = $app->protect(function() { |
|
308 | 308 | $paginator = new \Knp\Component\Pager\Paginator(); |
309 | 309 | $paginator->subscribe(new \Eccube\EventListener\PaginatorListener()); |
310 | 310 | |
311 | 311 | return $paginator; |
312 | 312 | }); |
313 | 313 | |
314 | - $app['eccube.repository.help'] = function () use ($app) { |
|
314 | + $app['eccube.repository.help'] = function() use ($app) { |
|
315 | 315 | return $app['orm.em']->getRepository('Eccube\Entity\Help'); |
316 | 316 | }; |
317 | - $app['eccube.repository.plugin'] = function () use ($app) { |
|
317 | + $app['eccube.repository.plugin'] = function() use ($app) { |
|
318 | 318 | return $app['orm.em']->getRepository('Eccube\Entity\Plugin'); |
319 | 319 | }; |
320 | - $app['eccube.repository.plugin_event_handler'] = function () use ($app) { |
|
320 | + $app['eccube.repository.plugin_event_handler'] = function() use ($app) { |
|
321 | 321 | return $app['orm.em']->getRepository('Eccube\Entity\PluginEventHandler'); |
322 | 322 | }; |
323 | - $app['eccube.repository.layout'] = function () use ($app) { |
|
323 | + $app['eccube.repository.layout'] = function() use ($app) { |
|
324 | 324 | return $app['orm.em']->getRepository('Eccube\Entity\Layout'); |
325 | 325 | }; |
326 | 326 | |
327 | - $app['request_scope'] = function () { |
|
327 | + $app['request_scope'] = function() { |
|
328 | 328 | return new ParameterBag(); |
329 | 329 | }; |
330 | 330 | // TODO 使用するか検討 |
331 | - $app['eccube.twig.node.hello'] = $app->protect(function ($node, $compiler) { |
|
331 | + $app['eccube.twig.node.hello'] = $app->protect(function($node, $compiler) { |
|
332 | 332 | $compiler |
333 | 333 | ->addDebugInfo($node) |
334 | 334 | ->write("echo 'Helloooooo ' . ") |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | |
339 | 339 | }); |
340 | 340 | // TODO 使用するか検討 |
341 | - $app['eccube.twig.node.jiro'] = $app->protect(function ($node, $compiler) { |
|
341 | + $app['eccube.twig.node.jiro'] = $app->protect(function($node, $compiler) { |
|
342 | 342 | $compiler |
343 | 343 | ->addDebugInfo($node) |
344 | 344 | ->write("echo 'jirooooooo ' . ") |
@@ -349,7 +349,7 @@ discard block |
||
349 | 349 | }); |
350 | 350 | |
351 | 351 | // TODO 使用するか検討 |
352 | - $app['eccube.twig.generic_node_names'] = function () use ($app) { |
|
352 | + $app['eccube.twig.generic_node_names'] = function() use ($app) { |
|
353 | 353 | return [ |
354 | 354 | 'hello', |
355 | 355 | 'jiro', |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | }; |
359 | 359 | |
360 | 360 | // TODO 使用するか検討 |
361 | - $app['twig_parsers'] = function () use ($app) { |
|
361 | + $app['twig_parsers'] = function() use ($app) { |
|
362 | 362 | $GenericTokenParsers = []; |
363 | 363 | foreach ($app['eccube.twig.generic_node_names'] as $tagName) { |
364 | 364 | $GenericTokenParsers[] = new \Eccube\Twig\Extension\GenericTokenParser($app, $tagName); |
@@ -367,20 +367,20 @@ discard block |
||
367 | 367 | }; |
368 | 368 | |
369 | 369 | // TODO ServiceProvider から追加できるよう Collection にする |
370 | - $app['eccube.twig.block.templates'] = function () { |
|
370 | + $app['eccube.twig.block.templates'] = function() { |
|
371 | 371 | return [ |
372 | 372 | 'render_block.twig', |
373 | 373 | ]; |
374 | 374 | }; |
375 | 375 | |
376 | 376 | // Form\Type |
377 | - $app->extend('form.type.extensions', function ($extensions) use ($app) { |
|
377 | + $app->extend('form.type.extensions', function($extensions) use ($app) { |
|
378 | 378 | $extensions[] = new \Eccube\Form\Extension\HelpTypeExtension(); |
379 | 379 | $extensions[] = new \Eccube\Form\Extension\FreezeTypeExtension(); |
380 | 380 | $extensions[] = new \Eccube\Form\Extension\DoctrineOrmExtension($app['orm.em']); |
381 | 381 | return $extensions; |
382 | 382 | }); |
383 | - $app->extend('form.types', function ($types) use ($app) { |
|
383 | + $app->extend('form.types', function($types) use ($app) { |
|
384 | 384 | $types[] = new \Eccube\Form\Type\NameType($app['config']); |
385 | 385 | $types[] = new \Eccube\Form\Type\KanaType($app['config']); |
386 | 386 | $types[] = new \Eccube\Form\Type\TelType($app['config']); |
@@ -483,7 +483,7 @@ discard block |
||
483 | 483 | return $types; |
484 | 484 | }); |
485 | 485 | $app['eccube.entity.event.dispatcher']->addEventListener(new \Acme\Entity\SoldOutEventListener()); |
486 | - $app['eccube.queries'] = function () { |
|
486 | + $app['eccube.queries'] = function() { |
|
487 | 487 | return new \Eccube\Doctrine\Query\Queries(); |
488 | 488 | }; |
489 | 489 | // TODO QueryCustomizerの追加方法は要検討 |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | $this->register(new \Saxulum\Validator\Provider\SaxulumValidatorProvider()); |
171 | 171 | $this->register(new MobileDetectServiceProvider()); |
172 | 172 | |
173 | - $this->error(function (\Exception $e, Request $request, $code) { |
|
173 | + $this->error(function(\Exception $e, Request $request, $code) { |
|
174 | 174 | if ($this['debug']) { |
175 | 175 | return; |
176 | 176 | } |
@@ -264,14 +264,14 @@ discard block |
||
264 | 264 | return $router; |
265 | 265 | }); |
266 | 266 | |
267 | - $this['eccube.router.origin'] = function ($app) { |
|
267 | + $this['eccube.router.origin'] = function($app) { |
|
268 | 268 | $resource = __DIR__.'/Controller'; |
269 | 269 | $cachePrefix = 'Origin'; |
270 | 270 | |
271 | 271 | return $app['eccube.router']($resource, $cachePrefix); |
272 | 272 | }; |
273 | 273 | |
274 | - $this['eccube.routers.plugin'] = function ($app) { |
|
274 | + $this['eccube.routers.plugin'] = function($app) { |
|
275 | 275 | // TODO 有効なプラグインを対象とする必要がある. |
276 | 276 | $dirs = Finder::create() |
277 | 277 | ->in($app['config']['root_dir'].'/app/Plugin') |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | return $routers; |
289 | 289 | }; |
290 | 290 | |
291 | - $this['eccube.router.extend'] = function ($app) { |
|
291 | + $this['eccube.router.extend'] = function($app) { |
|
292 | 292 | // TODO ディレクトリ名は暫定 |
293 | 293 | $resource = $app['config']['root_dir'].'/app/Acme/Controller'; |
294 | 294 | $cachePrefix = 'Extend'; |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | return $router; |
299 | 299 | }; |
300 | 300 | |
301 | - $this->extend('request_matcher', function ($matcher, $app) { |
|
301 | + $this->extend('request_matcher', function($matcher, $app) { |
|
302 | 302 | $matchers = []; |
303 | 303 | $matchers[] = $app['eccube.router.extend']; |
304 | 304 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | return new ChainUrlMatcher($matchers, $app['request_context']); |
311 | 311 | }); |
312 | 312 | |
313 | - $this->extend('url_generator', function ($generator, $app) { |
|
313 | + $this->extend('url_generator', function($generator, $app) { |
|
314 | 314 | $generators = []; |
315 | 315 | $generators[] = $app['eccube.router.extend']; |
316 | 316 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | 'translator.cache_dir' => $this['debug'] ? null : $this['config']['root_dir'].'/app/cache/translator', |
342 | 342 | 'locale_fallbacks' => ['ja', 'en'], |
343 | 343 | )); |
344 | - $this->extend('translator', function ($translator, \Silex\Application $app) { |
|
344 | + $this->extend('translator', function($translator, \Silex\Application $app) { |
|
345 | 345 | $translator->addLoader('yaml', new \Symfony\Component\Translation\Loader\YamlFileLoader()); |
346 | 346 | |
347 | 347 | $file = __DIR__.'/Resource/locale/validator.'.$app['locale'].'.yml'; |
@@ -388,14 +388,14 @@ discard block |
||
388 | 388 | $this->register(new \Silex\Provider\TwigServiceProvider(), array( |
389 | 389 | 'twig.form.templates' => array('Form/form_layout.twig'), |
390 | 390 | )); |
391 | - $this->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
391 | + $this->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
392 | 392 | $twig->addExtension(new \Eccube\Twig\Extension\EccubeExtension($app)); |
393 | 393 | $twig->addExtension(new \Twig_Extension_StringLoader()); |
394 | 394 | |
395 | 395 | return $twig; |
396 | 396 | }); |
397 | 397 | |
398 | - $this->before(function (Request $request, \Silex\Application $app) { |
|
398 | + $this->before(function(Request $request, \Silex\Application $app) { |
|
399 | 399 | $app['admin'] = $app['front'] = false; |
400 | 400 | $pathinfo = rawurldecode($request->getPathInfo()); |
401 | 401 | if (strpos($pathinfo, '/'.trim($app['config']['admin_route'], '/').'/') === 0) { |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | } |
412 | 412 | $paths[] = $app['config']['template_admin_realdir']; |
413 | 413 | $paths[] = __DIR__.'/../../app/Plugin'; |
414 | - $cacheDir = __DIR__.'/../../app/cache/twig/admin'; |
|
414 | + $cacheDir = __DIR__.'/../../app/cache/twig/admin'; |
|
415 | 415 | } else { |
416 | 416 | // モバイル端末時、smartphoneディレクトリを探索パスに追加する. |
417 | 417 | if ($app['mobile_detect.device_type'] == \Eccube\Entity\Master\DeviceType::DEVICE_TYPE_SP) { |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | } |
427 | 427 | $paths[] = $app['config']['template_default_realdir']; |
428 | 428 | $paths[] = __DIR__.'/../../app/Plugin'; |
429 | - $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
|
429 | + $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
|
430 | 430 | } |
431 | 431 | $app['twig']->setCache($app['debug'] ? null : $cacheDir); |
432 | 432 | $app['twig.loader']->addLoader(new \Twig_Loader_Filesystem($paths)); |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | }, self::EARLY_EVENT); |
445 | 445 | |
446 | 446 | // twigのグローバル変数を定義. |
447 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
447 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
448 | 448 | // 未ログイン時にマイページや管理画面以下にアクセスするとSubRequestで実行されるため, |
449 | 449 | // $event->isMasterRequest()ではなく、グローバル変数が初期化済かどうかの判定を行う |
450 | 450 | if (isset($this['twig_global_initialized']) && $this['twig_global_initialized'] === true) { |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | // メール送信時の文字エンコード指定(デフォルトはUTF-8) |
531 | 531 | if (isset($this['config']['mail']['charset_iso_2022_jp']) && is_bool($this['config']['mail']['charset_iso_2022_jp'])) { |
532 | 532 | if ($this['config']['mail']['charset_iso_2022_jp'] === true) { |
533 | - \Swift::init(function () { |
|
533 | + \Swift::init(function() { |
|
534 | 534 | \Swift_DependencyContainer::getInstance() |
535 | 535 | ->register('mime.qpheaderencoder') |
536 | 536 | ->asAliasOf('mime.base64headerencoder'); |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | |
651 | 651 | $this->extend( |
652 | 652 | 'orm.em.config', |
653 | - function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
653 | + function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
654 | 654 | |
655 | 655 | /** @var $chain \Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain */ |
656 | 656 | $chain = $config->getMetadataDriverImpl(); |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | } |
673 | 673 | ); |
674 | 674 | |
675 | - $this->extend('orm.em', function (\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
675 | + $this->extend('orm.em', function(\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
676 | 676 | // tax_rule |
677 | 677 | $taxRuleRepository = $em->getRepository('Eccube\Entity\TaxRule'); |
678 | 678 | $taxRuleRepository->setApplication($app); |
@@ -705,7 +705,7 @@ discard block |
||
705 | 705 | // second level cacheの設定. |
706 | 706 | $this->extend( |
707 | 707 | 'orm.em.config', |
708 | - function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
708 | + function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
709 | 709 | $config->setSecondLevelCacheEnabled(); |
710 | 710 | $cacheConfig = $config->getSecondLevelCacheConfiguration(); |
711 | 711 | $regionConfig = $cacheConfig->getRegionsConfiguration(); |
@@ -794,31 +794,31 @@ discard block |
||
794 | 794 | array('^/mypage', 'ROLE_USER', $channel), |
795 | 795 | ); |
796 | 796 | |
797 | - $this['eccube.password_encoder'] = function ($app) { |
|
797 | + $this['eccube.password_encoder'] = function($app) { |
|
798 | 798 | return new \Eccube\Security\Core\Encoder\PasswordEncoder($app['config']); |
799 | 799 | }; |
800 | - $this['security.encoder_factory'] = function ($app) { |
|
800 | + $this['security.encoder_factory'] = function($app) { |
|
801 | 801 | return new \Symfony\Component\Security\Core\Encoder\EncoderFactory(array( |
802 | 802 | 'Eccube\Entity\Customer' => $app['eccube.password_encoder'], |
803 | 803 | 'Eccube\Entity\Member' => $app['eccube.password_encoder'], |
804 | 804 | )); |
805 | 805 | }; |
806 | - $this['eccube.event_listner.security'] = function ($app) { |
|
806 | + $this['eccube.event_listner.security'] = function($app) { |
|
807 | 807 | return new \Eccube\EventListener\SecurityEventListener($app['orm.em']); |
808 | 808 | }; |
809 | 809 | |
810 | 810 | // Voterの設定 |
811 | - $this['authority_voter'] = function ($app) { |
|
811 | + $this['authority_voter'] = function($app) { |
|
812 | 812 | return new \Eccube\Security\Voter\AuthorityVoter($app); |
813 | 813 | }; |
814 | 814 | |
815 | - $this->extend('security.voters', function ($voters, \Silex\Application $app) { |
|
815 | + $this->extend('security.voters', function($voters, \Silex\Application $app) { |
|
816 | 816 | $voters[] = $app['authority_voter']; |
817 | 817 | |
818 | 818 | return $voters; |
819 | 819 | }); |
820 | 820 | |
821 | - $this['security.access_manager'] = function ($app) { |
|
821 | + $this['security.access_manager'] = function($app) { |
|
822 | 822 | return new \Symfony\Component\Security\Core\Authorization\AccessDecisionManager($app['security.voters'], 'unanimous'); |
823 | 823 | }; |
824 | 824 | |
@@ -832,7 +832,7 @@ discard block |
||
832 | 832 | { |
833 | 833 | $config = $this['config']; |
834 | 834 | if (isset($config['trusted_proxies_connection_only']) && !empty($config['trusted_proxies_connection_only'])) { |
835 | - $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($config) { |
|
835 | + $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($config) { |
|
836 | 836 | // サブリクエストのREMOTE_ADDRも動的に設定を行う必要があるため、KernelEvents::REQUESTを使用する |
837 | 837 | Request::setTrustedProxies(array_merge(array($event->getRequest()->server->get('REMOTE_ADDR')), $config['trusted_proxies'])); |
838 | 838 | }, self::EARLY_EVENT); |
@@ -998,7 +998,7 @@ discard block |
||
998 | 998 | $app = $this; |
999 | 999 | |
1000 | 1000 | // Response Event(http cache対応、event実行は一番遅く設定) |
1001 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
1001 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
1002 | 1002 | |
1003 | 1003 | if (!$event->isMasterRequest()) { |
1004 | 1004 | return; |