@@ -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 | $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,197 +135,197 @@ 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 | 323 | |
| 324 | - $app['request_scope'] = function () { |
|
| 324 | + $app['request_scope'] = function() { |
|
| 325 | 325 | return new ParameterBag(); |
| 326 | 326 | }; |
| 327 | 327 | // TODO 使用するか検討 |
| 328 | - $app['eccube.twig.node.hello'] = $app->protect(function ($node, $compiler) { |
|
| 328 | + $app['eccube.twig.node.hello'] = $app->protect(function($node, $compiler) { |
|
| 329 | 329 | $compiler |
| 330 | 330 | ->addDebugInfo($node) |
| 331 | 331 | ->write("echo 'Helloooooo ' . ") |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | |
| 336 | 336 | }); |
| 337 | 337 | // TODO 使用するか検討 |
| 338 | - $app['eccube.twig.node.jiro'] = $app->protect(function ($node, $compiler) { |
|
| 338 | + $app['eccube.twig.node.jiro'] = $app->protect(function($node, $compiler) { |
|
| 339 | 339 | $compiler |
| 340 | 340 | ->addDebugInfo($node) |
| 341 | 341 | ->write("echo 'jirooooooo ' . ") |
@@ -346,7 +346,7 @@ discard block |
||
| 346 | 346 | }); |
| 347 | 347 | |
| 348 | 348 | // TODO 使用するか検討 |
| 349 | - $app['eccube.twig.generic_node_names'] = function () use ($app) { |
|
| 349 | + $app['eccube.twig.generic_node_names'] = function() use ($app) { |
|
| 350 | 350 | return [ |
| 351 | 351 | 'hello', |
| 352 | 352 | 'jiro', |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | }; |
| 356 | 356 | |
| 357 | 357 | // TODO 使用するか検討 |
| 358 | - $app['twig_parsers'] = function () use ($app) { |
|
| 358 | + $app['twig_parsers'] = function() use ($app) { |
|
| 359 | 359 | $GenericTokenParsers = []; |
| 360 | 360 | foreach ($app['eccube.twig.generic_node_names'] as $tagName) { |
| 361 | 361 | $GenericTokenParsers[] = new \Eccube\Twig\Extension\GenericTokenParser($app, $tagName); |
@@ -364,20 +364,20 @@ discard block |
||
| 364 | 364 | }; |
| 365 | 365 | |
| 366 | 366 | // TODO ServiceProvider から追加できるよう Collection にする |
| 367 | - $app['eccube.twig.block.templates'] = function () { |
|
| 367 | + $app['eccube.twig.block.templates'] = function() { |
|
| 368 | 368 | return [ |
| 369 | 369 | 'render_block.twig', |
| 370 | 370 | ]; |
| 371 | 371 | }; |
| 372 | 372 | |
| 373 | 373 | // Form\Type |
| 374 | - $app->extend('form.type.extensions', function ($extensions) use ($app) { |
|
| 374 | + $app->extend('form.type.extensions', function($extensions) use ($app) { |
|
| 375 | 375 | $extensions[] = new \Eccube\Form\Extension\HelpTypeExtension(); |
| 376 | 376 | $extensions[] = new \Eccube\Form\Extension\FreezeTypeExtension(); |
| 377 | 377 | $extensions[] = new \Eccube\Form\Extension\DoctrineOrmExtension($app['orm.em']); |
| 378 | 378 | return $extensions; |
| 379 | 379 | }); |
| 380 | - $app->extend('form.types', function ($types) use ($app) { |
|
| 380 | + $app->extend('form.types', function($types) use ($app) { |
|
| 381 | 381 | $types[] = new \Eccube\Form\Type\NameType($app['config']); |
| 382 | 382 | $types[] = new \Eccube\Form\Type\KanaType($app['config']); |
| 383 | 383 | $types[] = new \Eccube\Form\Type\TelType($app['config']); |
@@ -480,7 +480,7 @@ discard block |
||
| 480 | 480 | return $types; |
| 481 | 481 | }); |
| 482 | 482 | $app['eccube.entity.event.dispatcher']->addEventListener(new \Acme\Entity\SoldOutEventListener()); |
| 483 | - $app['eccube.queries'] = function () { |
|
| 483 | + $app['eccube.queries'] = function() { |
|
| 484 | 484 | return new \Eccube\Doctrine\Query\Queries(); |
| 485 | 485 | }; |
| 486 | 486 | // 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 | } |
@@ -42,13 +42,13 @@ |
||
| 42 | 42 | */ |
| 43 | 43 | public function register(Container $app) |
| 44 | 44 | { |
| 45 | - $app->extend('form.type.extensions', function ($extensions) use ($app) { |
|
| 45 | + $app->extend('form.type.extensions', function($extensions) use ($app) { |
|
| 46 | 46 | $extensions[] = new \Eccube\Form\Extension\HelpTypeExtension(); |
| 47 | 47 | |
| 48 | 48 | return $extensions; |
| 49 | 49 | }); |
| 50 | 50 | |
| 51 | - $app->extend('form.types', function ($types) use ($app) { |
|
| 51 | + $app->extend('form.types', function($types) use ($app) { |
|
| 52 | 52 | $types[] = new \Eccube\Form\Type\Install\Step1Type($app); |
| 53 | 53 | $types[] = new \Eccube\Form\Type\Install\Step3Type($app); |
| 54 | 54 | $types[] = new \Eccube\Form\Type\Install\Step4Type($app); |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | public function register(Container $app) |
| 34 | 34 | { |
| 35 | - $app['validator'] = function ($app) { |
|
| 35 | + $app['validator'] = function($app) { |
|
| 36 | 36 | |
| 37 | 37 | return new Validator( |
| 38 | 38 | $app['validator.mapping.class_metadata_factory'], |
@@ -43,17 +43,17 @@ discard block |
||
| 43 | 43 | ); |
| 44 | 44 | }; |
| 45 | 45 | |
| 46 | - $app['validator.mapping.class_metadata_factory'] = function ($app) { |
|
| 46 | + $app['validator.mapping.class_metadata_factory'] = function($app) { |
|
| 47 | 47 | return new ClassMetadataFactory(new StaticMethodLoader()); |
| 48 | 48 | }; |
| 49 | 49 | |
| 50 | - $app['validator.validator_factory'] = function () use ($app) { |
|
| 50 | + $app['validator.validator_factory'] = function() use ($app) { |
|
| 51 | 51 | $validators = isset($app['validator.validator_service_ids']) ? $app['validator.validator_service_ids'] : array(); |
| 52 | 52 | |
| 53 | 53 | return new ConstraintValidatorFactory($app, $validators); |
| 54 | 54 | }; |
| 55 | 55 | |
| 56 | - $app['validator.object_initializers'] = function ($app) { |
|
| 56 | + $app['validator.object_initializers'] = function($app) { |
|
| 57 | 57 | return array(); |
| 58 | 58 | }; |
| 59 | 59 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | public function register(Container $app) |
| 26 | 26 | { |
| 27 | 27 | // EventDispatcher |
| 28 | - $app['eccube.event.dispatcher'] = function () { |
|
| 28 | + $app['eccube.event.dispatcher'] = function() { |
|
| 29 | 29 | return new EventDispatcher(); |
| 30 | 30 | }; |
| 31 | 31 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $config = $pluginConfig['config']; |
| 37 | 37 | |
| 38 | 38 | if (isset($config['const'])) { |
| 39 | - $app->extend('config', function ($eccubeConfig) use ($config) { |
|
| 39 | + $app->extend('config', function($eccubeConfig) use ($config) { |
|
| 40 | 40 | $eccubeConfig[$config['code']] = array( |
| 41 | 41 | 'const' => $config['const'], |
| 42 | 42 | ); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | public function initPluginEventDispatcher(Application $app) |
| 73 | 73 | { |
| 74 | 74 | // hook point |
| 75 | - $app->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($app) { |
|
| 75 | + $app->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($app) { |
|
| 76 | 76 | if (!$event->isMasterRequest()) { |
| 77 | 77 | return; |
| 78 | 78 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 81 | 81 | }, Application::EARLY_EVENT); |
| 82 | 82 | |
| 83 | - $app->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($app) { |
|
| 83 | + $app->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($app) { |
|
| 84 | 84 | if (!$event->isMasterRequest()) { |
| 85 | 85 | return; |
| 86 | 86 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 90 | 90 | }); |
| 91 | 91 | |
| 92 | - $app->on(KernelEvents::RESPONSE, function (FilterResponseEvent $event) use ($app) { |
|
| 92 | + $app->on(KernelEvents::RESPONSE, function(FilterResponseEvent $event) use ($app) { |
|
| 93 | 93 | if (!$event->isMasterRequest()) { |
| 94 | 94 | return; |
| 95 | 95 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 99 | 99 | }); |
| 100 | 100 | |
| 101 | - $app->on(KernelEvents::RESPONSE, function (FilterResponseEvent $event) use ($app) { |
|
| 101 | + $app->on(KernelEvents::RESPONSE, function(FilterResponseEvent $event) use ($app) { |
|
| 102 | 102 | if (!$event->isMasterRequest()) { |
| 103 | 103 | return; |
| 104 | 104 | } |
@@ -106,13 +106,13 @@ discard block |
||
| 106 | 106 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 107 | 107 | }, Application::LATE_EVENT); |
| 108 | 108 | |
| 109 | - $app->on(KernelEvents::TERMINATE, function (PostResponseEvent $event) use ($app) { |
|
| 109 | + $app->on(KernelEvents::TERMINATE, function(PostResponseEvent $event) use ($app) { |
|
| 110 | 110 | $route = $event->getRequest()->attributes->get('_route'); |
| 111 | 111 | $hookpoint = "eccube.event.controller.$route.finish"; |
| 112 | 112 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 113 | 113 | }); |
| 114 | 114 | |
| 115 | - $app->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 115 | + $app->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 116 | 116 | if (!$event->isMasterRequest()) { |
| 117 | 117 | return; |
| 118 | 118 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | }); |
| 122 | 122 | |
| 123 | 123 | // Request Event |
| 124 | - $app->on(\Symfony\Component\HttpKernel\KernelEvents::REQUEST, function (\Symfony\Component\HttpKernel\Event\GetResponseEvent $event) use ($app) { |
|
| 124 | + $app->on(\Symfony\Component\HttpKernel\KernelEvents::REQUEST, function(\Symfony\Component\HttpKernel\Event\GetResponseEvent $event) use ($app) { |
|
| 125 | 125 | |
| 126 | 126 | if (!$event->isMasterRequest()) { |
| 127 | 127 | return; |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | }, 30); // Routing(32)が解決し, 認証判定(8)が実行される前のタイミング. |
| 153 | 153 | |
| 154 | 154 | // Controller Event |
| 155 | - $app->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) { |
|
| 155 | + $app->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) { |
|
| 156 | 156 | |
| 157 | 157 | if (!$event->isMasterRequest()) { |
| 158 | 158 | return; |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | }); |
| 182 | 182 | |
| 183 | 183 | // Response Event |
| 184 | - $app->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 184 | + $app->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 185 | 185 | if (!$event->isMasterRequest()) { |
| 186 | 186 | return; |
| 187 | 187 | } |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | }); |
| 211 | 211 | |
| 212 | 212 | // Exception Event |
| 213 | - $app->on(\Symfony\Component\HttpKernel\KernelEvents::EXCEPTION, function (\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event) use ($app) { |
|
| 213 | + $app->on(\Symfony\Component\HttpKernel\KernelEvents::EXCEPTION, function(\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event) use ($app) { |
|
| 214 | 214 | |
| 215 | 215 | if (!$event->isMasterRequest()) { |
| 216 | 216 | return; |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | }); |
| 241 | 241 | |
| 242 | 242 | // Terminate Event |
| 243 | - $app->on(\Symfony\Component\HttpKernel\KernelEvents::TERMINATE, function (\Symfony\Component\HttpKernel\Event\PostResponseEvent $event) use ($app) { |
|
| 243 | + $app->on(\Symfony\Component\HttpKernel\KernelEvents::TERMINATE, function(\Symfony\Component\HttpKernel\Event\PostResponseEvent $event) use ($app) { |
|
| 244 | 244 | |
| 245 | 245 | $route = $event->getRequest()->attributes->get('_route'); |
| 246 | 246 | |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | 'label' => false, |
| 42 | 42 | 'class' => 'Eccube\Entity\PageLayout', |
| 43 | 43 | 'choice_label' => 'name', |
| 44 | - 'query_builder' => function (EntityRepository $er) { |
|
| 44 | + 'query_builder' => function(EntityRepository $er) { |
|
| 45 | 45 | return $er |
| 46 | 46 | ->createQueryBuilder('l') |
| 47 | 47 | ->where('l.id <> 0') |
@@ -57,8 +57,8 @@ |
||
| 57 | 57 | new Assert\NotBlank(), |
| 58 | 58 | new Assert\Length(array('max' => $this->config['stext_len'])), |
| 59 | 59 | new Assert\Regex(array( |
| 60 | - 'pattern' => "/^[0-9a-zA-Z]+$/", |
|
| 61 | - )), |
|
| 60 | + 'pattern' => "/^[0-9a-zA-Z]+$/", |
|
| 61 | + )), |
|
| 62 | 62 | ), |
| 63 | 63 | )) |
| 64 | 64 | ->add('admin_allow_host', TextareaType::class, array( |
@@ -72,19 +72,19 @@ |
||
| 72 | 72 | 'label' => 'SSLを強制', |
| 73 | 73 | 'required' => false, |
| 74 | 74 | )) |
| 75 | - ->addEventListener(FormEvents::POST_SUBMIT, function ($event) use($app) { |
|
| 75 | + ->addEventListener(FormEvents::POST_SUBMIT, function($event) use($app) { |
|
| 76 | 76 | $form = $event->getForm(); |
| 77 | 77 | $data = $form->getData(); |
| 78 | 78 | |
| 79 | 79 | $ips = preg_split("/\R/", $data['admin_allow_host'], null, PREG_SPLIT_NO_EMPTY); |
| 80 | 80 | |
| 81 | - foreach($ips as $ip) { |
|
| 81 | + foreach ($ips as $ip) { |
|
| 82 | 82 | $errors = $app['validator']->validate($ip, array( |
| 83 | 83 | new Assert\Ip(), |
| 84 | 84 | ) |
| 85 | 85 | ); |
| 86 | 86 | if ($errors->count() != 0) { |
| 87 | - $form['admin_allow_host']->addError(new FormError($ip . 'はIPv4アドレスではありません。')); |
|
| 87 | + $form['admin_allow_host']->addError(new FormError($ip.'はIPv4アドレスではありません。')); |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | }) |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | ))); |
| 115 | 115 | |
| 116 | 116 | $app = $this->app; |
| 117 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($app) { |
|
| 117 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($app) { |
|
| 118 | 118 | // モーダルからのPOST時に、金額等をセットする. |
| 119 | 119 | if ('modal' === $app['request_stack']->getCurrentRequest()->get('modal')) { |
| 120 | 120 | $data = $event->getData(); |
@@ -131,17 +131,13 @@ discard block |
||
| 131 | 131 | $data['product_name'] = $Product->getName(); |
| 132 | 132 | $data['product_code'] = $ProductClass->getCode(); |
| 133 | 133 | $data['class_name1'] = $ProductClass->hasClassCategory1() ? |
| 134 | - $ProductClass->getClassCategory1()->getClassName() : |
|
| 135 | - null; |
|
| 134 | + $ProductClass->getClassCategory1()->getClassName() : null; |
|
| 136 | 135 | $data['class_name2'] = $ProductClass->hasClassCategory2() ? |
| 137 | - $ProductClass->getClassCategory2()->getClassName() : |
|
| 138 | - null; |
|
| 136 | + $ProductClass->getClassCategory2()->getClassName() : null; |
|
| 139 | 137 | $data['class_category_name1'] = $ProductClass->hasClassCategory1() ? |
| 140 | - $ProductClass->getClassCategory1()->getName() : |
|
| 141 | - null; |
|
| 138 | + $ProductClass->getClassCategory1()->getName() : null; |
|
| 142 | 139 | $data['class_category_name2'] = $ProductClass->hasClassCategory2() ? |
| 143 | - $ProductClass->getClassCategory2()->getName() : |
|
| 144 | - null; |
|
| 140 | + $ProductClass->getClassCategory2()->getName() : null; |
|
| 145 | 141 | $data['tax_rule'] = $TaxRule->getCalcRule()->getId(); |
| 146 | 142 | $data['price'] = $ProductClass->getPrice02(); |
| 147 | 143 | $data['quantity'] = empty($data['quantity']) ? 1 : $data['quantity']; |