@@ -650,7 +650,7 @@ |
||
| 650 | 650 | * - 受注ステータスが発送済に設定された場合に発送日を更新 |
| 651 | 651 | * - 受注ステータスが入金済に設定された場合に入金日を更新 |
| 652 | 652 | * |
| 653 | - * @param $app |
|
| 653 | + * @param Application $app |
|
| 654 | 654 | * @param $TargetOrder |
| 655 | 655 | * @param $OriginOrder |
| 656 | 656 | * |
@@ -4,25 +4,17 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Doctrine\Common\Collections\ArrayCollection; |
| 6 | 6 | use Eccube\Application; |
| 7 | -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; |
|
| 8 | 7 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
| 9 | 8 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security; |
| 10 | 9 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; |
| 11 | 10 | use Symfony\Component\HttpFoundation\Request; |
| 12 | - |
|
| 13 | -use Eccube\Common\Constant; |
|
| 14 | -use Eccube\Controller\AbstractController; |
|
| 15 | 11 | use Eccube\Entity\Shipping; |
| 16 | -use Eccube\Entity\Master\CsvType; |
|
| 17 | 12 | use Eccube\Event\EccubeEvents; |
| 18 | 13 | use Eccube\Event\EventArgs; |
| 19 | -use Eccube\Form\Type\AddCartType; |
|
| 20 | -use Eccube\Form\Type\Admin\SearchOrderType; |
|
| 21 | 14 | use Eccube\Form\Type\Admin\ShippingType; |
| 22 | 15 | use Eccube\Form\Type\Admin\SearchCustomerType; |
| 23 | 16 | use Eccube\Form\Type\Admin\SearchProductType; |
| 24 | 17 | use Eccube\Form\Type\Admin\ShipmentItemType; |
| 25 | -use Symfony\Component\HttpFoundation\StreamedResponse; |
|
| 26 | 18 | |
| 27 | 19 | /** |
| 28 | 20 | * // FIXME UrlGenerator で {_admin} を認識しない問題あり |
@@ -446,7 +446,7 @@ |
||
| 446 | 446 | $session->set('eccube.admin.order.product.search', $searchData); |
| 447 | 447 | $session->set('eccube.admin.order.product.search.page_no', $page_no); |
| 448 | 448 | } else { |
| 449 | - $searchData = (array)$session->get('eccube.admin.order.product.search'); |
|
| 449 | + $searchData = (array) $session->get('eccube.admin.order.product.search'); |
|
| 450 | 450 | if (is_null($page_no)) { |
| 451 | 451 | $page_no = intval($session->get('eccube.admin.order.product.search.page_no')); |
| 452 | 452 | } else { |
@@ -53,6 +53,9 @@ |
||
| 53 | 53 | |
| 54 | 54 | protected $app; |
| 55 | 55 | |
| 56 | + /** |
|
| 57 | + * @param \Pimple\Container $app |
|
| 58 | + */ |
|
| 56 | 59 | public function __construct($app) |
| 57 | 60 | { |
| 58 | 61 | $this->app = $app; |
@@ -35,7 +35,6 @@ |
||
| 35 | 35 | use Symfony\Component\Form\AbstractType; |
| 36 | 36 | use Symfony\Component\Form\Extension\Core\Type\CollectionType; |
| 37 | 37 | use Symfony\Component\Form\Extension\Core\Type\EmailType; |
| 38 | -use Symfony\Component\Form\Extension\Core\Type\FormType; |
|
| 39 | 38 | use Symfony\Component\Form\Extension\Core\Type\HiddenType; |
| 40 | 39 | use Symfony\Component\Form\Extension\Core\Type\MoneyType; |
| 41 | 40 | use Symfony\Component\Form\Extension\Core\Type\TextareaType; |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | /** |
| 257 | 257 | * 複数配送オプション有効時の画面制御を行う. |
| 258 | 258 | */ |
| 259 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($BaseInfo) { |
|
| 259 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($BaseInfo) { |
|
| 260 | 260 | |
| 261 | 261 | if ($BaseInfo->getOptionMultipleShipping() != Constant::ENABLED) { |
| 262 | 262 | return; |
@@ -266,17 +266,16 @@ discard block |
||
| 266 | 266 | $orderDetails = &$data['OrderDetails']; |
| 267 | 267 | |
| 268 | 268 | // 数量0フィルター |
| 269 | - $quantityFilter = function ($v) { |
|
| 269 | + $quantityFilter = function($v) { |
|
| 270 | 270 | return !(isset($v['quantity']) && preg_match('/^0+$/', trim($v['quantity']))); |
| 271 | 271 | }; |
| 272 | 272 | |
| 273 | 273 | // $shippings = &$data['Shippings']; |
| 274 | 274 | |
| 275 | 275 | // 数量を抽出 |
| 276 | - $getQuantity = function ($v) { |
|
| 276 | + $getQuantity = function($v) { |
|
| 277 | 277 | return (isset($v['quantity']) && preg_match('/^\d+$/', trim($v['quantity']))) ? |
| 278 | - trim($v['quantity']) : |
|
| 279 | - 0; |
|
| 278 | + trim($v['quantity']) : 0; |
|
| 280 | 279 | }; |
| 281 | 280 | |
| 282 | 281 | // foreach ($shippings as &$shipping) { |
@@ -293,7 +292,7 @@ discard block |
||
| 293 | 292 | $orderDetail['quantity'] = 0; |
| 294 | 293 | |
| 295 | 294 | // 受注詳細と同じ商品規格のみ抽出 |
| 296 | - $productClassFilter = function ($v) use ($orderDetail) { |
|
| 295 | + $productClassFilter = function($v) use ($orderDetail) { |
|
| 297 | 296 | return $orderDetail['ProductClass'] === $v['ProductClass']; |
| 298 | 297 | }; |
| 299 | 298 | |
@@ -302,10 +301,9 @@ discard block |
||
| 302 | 301 | if (!empty($shipping['ShipmentItems'])) { |
| 303 | 302 | |
| 304 | 303 | // 同じ商品規格の受注詳細の価格を適用 |
| 305 | - $applyPrice = function (&$v) use ($orderDetail) { |
|
| 304 | + $applyPrice = function(&$v) use ($orderDetail) { |
|
| 306 | 305 | $v['price'] = ($v['ProductClass'] === $orderDetail['ProductClass']) ? |
| 307 | - $orderDetail['price'] : |
|
| 308 | - $v['price']; |
|
| 306 | + $orderDetail['price'] : $v['price']; |
|
| 309 | 307 | }; |
| 310 | 308 | array_walk($shipping['ShipmentItems'], $applyPrice); |
| 311 | 309 | |
@@ -334,7 +332,7 @@ discard block |
||
| 334 | 332 | // } |
| 335 | 333 | // }); |
| 336 | 334 | // 選択された支払い方法の名称をエンティティにコピーする |
| 337 | - $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { |
|
| 335 | + $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) { |
|
| 338 | 336 | $Order = $event->getData(); |
| 339 | 337 | $Payment = $Order->getPayment(); |
| 340 | 338 | if (!is_null($Payment)) { |
@@ -342,7 +340,7 @@ discard block |
||
| 342 | 340 | } |
| 343 | 341 | }); |
| 344 | 342 | // 会員受注の場合、会員の性別/職業/誕生日をエンティティにコピーする |
| 345 | - $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { |
|
| 343 | + $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) { |
|
| 346 | 344 | $Order = $event->getData(); |
| 347 | 345 | $Customer = $Order->getCustomer(); |
| 348 | 346 | if (!is_null($Customer)) { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | // 配送業者のプルダウンを生成 |
| 60 | 60 | $builder->addEventListener( |
| 61 | 61 | FormEvents::PRE_SET_DATA, |
| 62 | - function (FormEvent $event) { |
|
| 62 | + function(FormEvent $event) { |
|
| 63 | 63 | /* @var Shipping $Shipping */ |
| 64 | 64 | $Shipping = $event->getData(); |
| 65 | 65 | if (is_null($Shipping) || !$Shipping->getId()) { |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | // お届け日のプルダウンを生成 |
| 102 | 102 | $builder->addEventListener( |
| 103 | 103 | FormEvents::PRE_SET_DATA, |
| 104 | - function (FormEvent $event) { |
|
| 104 | + function(FormEvent $event) { |
|
| 105 | 105 | $Shipping = $event->getData(); |
| 106 | 106 | if (is_null($Shipping) || !$Shipping->getId()) { |
| 107 | 107 | return; |
@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | // 配送日数が設定されている |
| 141 | 141 | if ($deliveryDateFlag) { |
| 142 | - $period = new \DatePeriod ( |
|
| 142 | + $period = new \DatePeriod( |
|
| 143 | 143 | new \DateTime($minDate.' day'), |
| 144 | 144 | new \DateInterval('P1D'), |
| 145 | 145 | new \DateTime($minDate + $this->config['deliv_date_end_max'].' day') |
@@ -167,7 +167,7 @@ discard block |
||
| 167 | 167 | // お届け時間のプルダウンを生成 |
| 168 | 168 | $builder->addEventListener( |
| 169 | 169 | FormEvents::PRE_SET_DATA, |
| 170 | - function (FormEvent $event) { |
|
| 170 | + function(FormEvent $event) { |
|
| 171 | 171 | $Shipping = $event->getData(); |
| 172 | 172 | if (is_null($Shipping) || !$Shipping->getId()) { |
| 173 | 173 | return; |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | // 支払い方法のプルダウンを生成 |
| 86 | 86 | $builder->addEventListener( |
| 87 | 87 | FormEvents::PRE_SET_DATA, |
| 88 | - function (FormEvent $event) { |
|
| 88 | + function(FormEvent $event) { |
|
| 89 | 89 | /** @var Order $Order */ |
| 90 | 90 | $Order = $event->getData(); |
| 91 | 91 | if (is_null($Order) || !$Order->getId()) { |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | // TODO Calculatorで行うのが適切. |
| 134 | 134 | $builder->addEventListener( |
| 135 | 135 | FormEvents::POST_SUBMIT, |
| 136 | - function (FormEvent $event) { |
|
| 136 | + function(FormEvent $event) { |
|
| 137 | 137 | /** @var Order $Order */ |
| 138 | 138 | $Order = $event->getData(); |
| 139 | 139 | $Payment = $Order->getPayment(); |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | ))); |
| 144 | 144 | |
| 145 | 145 | $app = $this->app; |
| 146 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($app) { |
|
| 146 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($app) { |
|
| 147 | 147 | // モーダルからのPOST時に、金額等をセットする. |
| 148 | 148 | if ('modal' === $app['request_stack']->getCurrentRequest()->get('modal')) { |
| 149 | 149 | $data = $event->getData(); |
@@ -213,17 +213,13 @@ discard block |
||
| 213 | 213 | $data['product_name'] = $Product->getName(); |
| 214 | 214 | $data['product_code'] = $ProductClass->getCode(); |
| 215 | 215 | $data['class_name1'] = $ProductClass->hasClassCategory1() ? |
| 216 | - $ProductClass->getClassCategory1()->getClassName() : |
|
| 217 | - null; |
|
| 216 | + $ProductClass->getClassCategory1()->getClassName() : null; |
|
| 218 | 217 | $data['class_name2'] = $ProductClass->hasClassCategory2() ? |
| 219 | - $ProductClass->getClassCategory2()->getClassName() : |
|
| 220 | - null; |
|
| 218 | + $ProductClass->getClassCategory2()->getClassName() : null; |
|
| 221 | 219 | $data['class_category_name1'] = $ProductClass->hasClassCategory1() ? |
| 222 | - $ProductClass->getClassCategory1()->getName() : |
|
| 223 | - null; |
|
| 220 | + $ProductClass->getClassCategory1()->getName() : null; |
|
| 224 | 221 | $data['class_category_name2'] = $ProductClass->hasClassCategory2() ? |
| 225 | - $ProductClass->getClassCategory2()->getName() : |
|
| 226 | - null; |
|
| 222 | + $ProductClass->getClassCategory2()->getName() : null; |
|
| 227 | 223 | $data['price'] = $ProductClass->getPrice02(); |
| 228 | 224 | $data['quantity'] = empty($data['quantity']) ? 1 : $data['quantity']; |
| 229 | 225 | $data['tax_type'] = TaxType::TAXATION; |
@@ -175,7 +175,7 @@ discard block |
||
| 175 | 175 | 'prototype' => true, |
| 176 | 176 | )) |
| 177 | 177 | |
| 178 | - ->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) use ($BaseInfo) { |
|
| 178 | + ->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) use ($BaseInfo) { |
|
| 179 | 179 | if ($BaseInfo->getOptionMultipleShipping() == Constant::ENABLED) { |
| 180 | 180 | $form = $event->getForm(); |
| 181 | 181 | $form->add('ShipmentItems', CollectionType::class, array( |
@@ -186,7 +186,7 @@ discard block |
||
| 186 | 186 | )); |
| 187 | 187 | } |
| 188 | 188 | }) |
| 189 | - ->addEventListener(FormEvents::POST_SET_DATA, function (FormEvent $event) { |
|
| 189 | + ->addEventListener(FormEvents::POST_SET_DATA, function(FormEvent $event) { |
|
| 190 | 190 | /** @var \Eccube\Entity\Shipping $data */ |
| 191 | 191 | $data = $event->getData(); |
| 192 | 192 | /** @var \Symfony\Component\Form\Form $form */ |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | 'choice_label' => 'delivery_time', |
| 206 | 206 | 'placeholder' => '指定なし', |
| 207 | 207 | 'required' => false, |
| 208 | - 'query_builder' => function (EntityRepository $er) use($Delivery) { |
|
| 208 | + 'query_builder' => function(EntityRepository $er) use($Delivery) { |
|
| 209 | 209 | return $er->createQueryBuilder('dt') |
| 210 | 210 | ->where('dt.Delivery = :Delivery') |
| 211 | 211 | ->setParameter('Delivery', $Delivery); |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | )); |
| 214 | 214 | |
| 215 | 215 | }) |
| 216 | - ->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($app) { |
|
| 216 | + ->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($app) { |
|
| 217 | 217 | $data = $event->getData(); |
| 218 | 218 | $form = $event->getForm(); |
| 219 | 219 | if (!$data) { |
@@ -233,14 +233,14 @@ discard block |
||
| 233 | 233 | 'choice_label' => 'delivery_time', |
| 234 | 234 | 'placeholder' => '指定なし', |
| 235 | 235 | 'required' => false, |
| 236 | - 'query_builder' => function (EntityRepository $er) use($Delivery) { |
|
| 236 | + 'query_builder' => function(EntityRepository $er) use($Delivery) { |
|
| 237 | 237 | return $er->createQueryBuilder('dt') |
| 238 | 238 | ->where('dt.Delivery = :Delivery') |
| 239 | 239 | ->setParameter('Delivery', $Delivery); |
| 240 | 240 | }, |
| 241 | 241 | )); |
| 242 | 242 | }) |
| 243 | - ->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($BaseInfo) { |
|
| 243 | + ->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) use ($BaseInfo) { |
|
| 244 | 244 | if ($BaseInfo->getOptionMultipleShipping() == Constant::ENABLED) { |
| 245 | 245 | $form = $event->getForm(); |
| 246 | 246 | $shipmentItems = $form['ShipmentItems']->getData(); |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | } |
| 252 | 252 | } |
| 253 | 253 | }) |
| 254 | - ->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) use ($BaseInfo) { |
|
| 254 | + ->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) use ($BaseInfo) { |
|
| 255 | 255 | $Shipping = $event->getData(); |
| 256 | 256 | $Delivery = $Shipping->getDelivery(); |
| 257 | 257 | $Shipping->setShippingDeliveryName($Delivery ? $Delivery : null); |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $this->register(new \Saxulum\Validator\Provider\SaxulumValidatorProvider()); |
| 161 | 161 | $this->register(new MobileDetectServiceProvider()); |
| 162 | 162 | |
| 163 | - $this->error(function (\Exception $e, Request $request, $code) { |
|
| 163 | + $this->error(function(\Exception $e, Request $request, $code) { |
|
| 164 | 164 | if ($this['debug']) { |
| 165 | 165 | return; |
| 166 | 166 | } |
@@ -254,14 +254,14 @@ discard block |
||
| 254 | 254 | return $router; |
| 255 | 255 | }); |
| 256 | 256 | |
| 257 | - $this['eccube.router.origin'] = function ($app) { |
|
| 257 | + $this['eccube.router.origin'] = function($app) { |
|
| 258 | 258 | $resource = __DIR__.'/Controller'; |
| 259 | 259 | $cachePrefix = 'Origin'; |
| 260 | 260 | |
| 261 | 261 | return $app['eccube.router']($resource, $cachePrefix); |
| 262 | 262 | }; |
| 263 | 263 | |
| 264 | - $this['eccube.routers.plugin'] = function ($app) { |
|
| 264 | + $this['eccube.routers.plugin'] = function($app) { |
|
| 265 | 265 | // TODO 有効なプラグインを対象とする必要がある. |
| 266 | 266 | $dirs = Finder::create() |
| 267 | 267 | ->in($app['config']['root_dir'].'/app/Plugin') |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | return $routers; |
| 279 | 279 | }; |
| 280 | 280 | |
| 281 | - $this['eccube.router.extend'] = function ($app) { |
|
| 281 | + $this['eccube.router.extend'] = function($app) { |
|
| 282 | 282 | // TODO ディレクトリ名は暫定 |
| 283 | 283 | $resource = $app['config']['root_dir'].'/app/Acme/Controller'; |
| 284 | 284 | $cachePrefix = 'Extend'; |
@@ -288,7 +288,7 @@ discard block |
||
| 288 | 288 | return $router; |
| 289 | 289 | }; |
| 290 | 290 | |
| 291 | - $this->extend('request_matcher', function ($matcher, $app) { |
|
| 291 | + $this->extend('request_matcher', function($matcher, $app) { |
|
| 292 | 292 | $matchers = []; |
| 293 | 293 | $matchers[] = $app['eccube.router.extend']; |
| 294 | 294 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -300,7 +300,7 @@ discard block |
||
| 300 | 300 | return new ChainUrlMatcher($matchers, $app['request_context']); |
| 301 | 301 | }); |
| 302 | 302 | |
| 303 | - $this->extend('url_generator', function ($generator, $app) { |
|
| 303 | + $this->extend('url_generator', function($generator, $app) { |
|
| 304 | 304 | $generators = []; |
| 305 | 305 | $generators[] = $app['eccube.router.extend']; |
| 306 | 306 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -313,7 +313,7 @@ discard block |
||
| 313 | 313 | }); |
| 314 | 314 | |
| 315 | 315 | // TODO この設定が正しいか要確認 |
| 316 | - $this->extend('routes_factory', function ($routes, $app ) { |
|
| 316 | + $this->extend('routes_factory', function($routes, $app) { |
|
| 317 | 317 | return $this['sensio_framework_extra.routing.loader.annot_dir']->load($this['config']['root_dir'].'/src/Eccube/Controller'); |
| 318 | 318 | }); |
| 319 | 319 | // init http cache |
@@ -335,7 +335,7 @@ discard block |
||
| 335 | 335 | 'translator.cache_dir' => $this['debug'] ? null : $this['config']['root_dir'].'/app/cache/translator', |
| 336 | 336 | 'locale_fallbacks' => ['ja', 'en'], |
| 337 | 337 | )); |
| 338 | - $this->extend('translator', function ($translator, \Silex\Application $app) { |
|
| 338 | + $this->extend('translator', function($translator, \Silex\Application $app) { |
|
| 339 | 339 | $translator->addLoader('yaml', new \Symfony\Component\Translation\Loader\YamlFileLoader()); |
| 340 | 340 | |
| 341 | 341 | $file = __DIR__.'/Resource/locale/validator.'.$app['locale'].'.yml'; |
@@ -382,14 +382,14 @@ discard block |
||
| 382 | 382 | $this->register(new \Silex\Provider\TwigServiceProvider(), array( |
| 383 | 383 | 'twig.form.templates' => array('Form/form_layout.twig'), |
| 384 | 384 | )); |
| 385 | - $this->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
| 385 | + $this->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
| 386 | 386 | $twig->addExtension(new \Eccube\Twig\Extension\EccubeExtension($app)); |
| 387 | 387 | $twig->addExtension(new \Twig_Extension_StringLoader()); |
| 388 | 388 | |
| 389 | 389 | return $twig; |
| 390 | 390 | }); |
| 391 | 391 | |
| 392 | - $this->before(function (Request $request, \Silex\Application $app) { |
|
| 392 | + $this->before(function(Request $request, \Silex\Application $app) { |
|
| 393 | 393 | $app['admin'] = $app['front'] = false; |
| 394 | 394 | $pathinfo = rawurldecode($request->getPathInfo()); |
| 395 | 395 | if (strpos($pathinfo, '/'.trim($app['config']['admin_route'], '/').'/') === 0) { |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | } |
| 406 | 406 | $paths[] = $app['config']['template_admin_realdir']; |
| 407 | 407 | $paths[] = __DIR__.'/../../app/Plugin'; |
| 408 | - $cacheDir = __DIR__.'/../../app/cache/twig/admin'; |
|
| 408 | + $cacheDir = __DIR__.'/../../app/cache/twig/admin'; |
|
| 409 | 409 | } else { |
| 410 | 410 | // モバイル端末時、smartphoneディレクトリを探索パスに追加する. |
| 411 | 411 | if ($app['mobile_detect.device_type'] == \Eccube\Entity\Master\DeviceType::DEVICE_TYPE_SP) { |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | } |
| 421 | 421 | $paths[] = $app['config']['template_default_realdir']; |
| 422 | 422 | $paths[] = __DIR__.'/../../app/Plugin'; |
| 423 | - $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
|
| 423 | + $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
|
| 424 | 424 | } |
| 425 | 425 | $app['twig']->setCache($app['debug'] ? null : $cacheDir); |
| 426 | 426 | $app['twig.loader']->addLoader(new \Twig_Loader_Filesystem($paths)); |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | }, self::EARLY_EVENT); |
| 439 | 439 | |
| 440 | 440 | // twigのグローバル変数を定義. |
| 441 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
| 441 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
| 442 | 442 | // 未ログイン時にマイページや管理画面以下にアクセスするとSubRequestで実行されるため, |
| 443 | 443 | // $event->isMasterRequest()ではなく、グローバル変数が初期化済かどうかの判定を行う |
| 444 | 444 | if (isset($this['twig_global_initialized']) && $this['twig_global_initialized'] === true) { |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | // メール送信時の文字エンコード指定(デフォルトはUTF-8) |
| 525 | 525 | if (isset($this['config']['mail']['charset_iso_2022_jp']) && is_bool($this['config']['mail']['charset_iso_2022_jp'])) { |
| 526 | 526 | if ($this['config']['mail']['charset_iso_2022_jp'] === true) { |
| 527 | - \Swift::init(function () { |
|
| 527 | + \Swift::init(function() { |
|
| 528 | 528 | \Swift_DependencyContainer::getInstance() |
| 529 | 529 | ->register('mime.qpheaderencoder') |
| 530 | 530 | ->asAliasOf('mime.base64headerencoder'); |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | $this->register(new \Saxulum\DoctrineOrmManagerRegistry\Provider\DoctrineOrmManagerRegistryProvider()); |
| 560 | 560 | |
| 561 | 561 | $app = $this; |
| 562 | - $this->extend('db.event_manager', function ($evm) use ($app) { |
|
| 562 | + $this->extend('db.event_manager', function($evm) use ($app) { |
|
| 563 | 563 | $initSubscriber = new InitSubscriber($app); |
| 564 | 564 | $evm->addEventSubscriber($initSubscriber); |
| 565 | 565 | |
@@ -654,7 +654,7 @@ discard block |
||
| 654 | 654 | |
| 655 | 655 | $this->extend( |
| 656 | 656 | 'orm.em.config', |
| 657 | - function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
| 657 | + function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
| 658 | 658 | |
| 659 | 659 | /** @var $chain \Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain */ |
| 660 | 660 | $chain = $config->getMetadataDriverImpl(); |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | } |
| 677 | 677 | ); |
| 678 | 678 | |
| 679 | - $this->extend('orm.em', function (\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
| 679 | + $this->extend('orm.em', function(\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
| 680 | 680 | // tax_rule |
| 681 | 681 | $taxRuleRepository = $em->getRepository('Eccube\Entity\TaxRule'); |
| 682 | 682 | $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); |
@@ -849,7 +849,7 @@ discard block |
||
| 849 | 849 | $this->register(new ServiceProvider\EccubePluginServiceProvider()); |
| 850 | 850 | |
| 851 | 851 | // TODO Acme\ServiceProvider の初期化はここで OK? |
| 852 | - if (array_key_exists('service',$this['config'])) { |
|
| 852 | + if (array_key_exists('service', $this['config'])) { |
|
| 853 | 853 | foreach ($this['config']['service'] as $service) { |
| 854 | 854 | $this->register(new $service); |
| 855 | 855 | } |
@@ -1005,7 +1005,7 @@ discard block |
||
| 1005 | 1005 | $app = $this; |
| 1006 | 1006 | |
| 1007 | 1007 | // Response Event(http cache対応、event実行は一番遅く設定) |
| 1008 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 1008 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 1009 | 1009 | |
| 1010 | 1010 | if (!$event->isMasterRequest()) { |
| 1011 | 1011 | return; |
@@ -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,206 +135,206 @@ 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 | - $app['eccube.repository.master.order_item_type'] = function () use ($app) { |
|
| 181 | + $app['eccube.repository.master.order_item_type'] = function() use ($app) { |
|
| 182 | 182 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderItemType'); |
| 183 | 183 | }; |
| 184 | 184 | |
| 185 | - $app['eccube.repository.delivery'] = function () use ($app) { |
|
| 185 | + $app['eccube.repository.delivery'] = function() use ($app) { |
|
| 186 | 186 | return $app['orm.em']->getRepository('Eccube\Entity\Delivery'); |
| 187 | 187 | }; |
| 188 | - $app['eccube.repository.delivery_date'] = function () use ($app) { |
|
| 188 | + $app['eccube.repository.delivery_date'] = function() use ($app) { |
|
| 189 | 189 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryDate'); |
| 190 | 190 | }; |
| 191 | - $app['eccube.repository.delivery_fee'] = function () use ($app) { |
|
| 191 | + $app['eccube.repository.delivery_fee'] = function() use ($app) { |
|
| 192 | 192 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryFee'); |
| 193 | 193 | }; |
| 194 | - $app['eccube.repository.delivery_time'] = function () use ($app) { |
|
| 194 | + $app['eccube.repository.delivery_time'] = function() use ($app) { |
|
| 195 | 195 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryTime'); |
| 196 | 196 | }; |
| 197 | - $app['eccube.repository.payment'] = function () use ($app) { |
|
| 197 | + $app['eccube.repository.payment'] = function() use ($app) { |
|
| 198 | 198 | return $app['orm.em']->getRepository('Eccube\Entity\Payment'); |
| 199 | 199 | }; |
| 200 | - $app['eccube.repository.payment_option'] = function () use ($app) { |
|
| 200 | + $app['eccube.repository.payment_option'] = function() use ($app) { |
|
| 201 | 201 | return $app['orm.em']->getRepository('Eccube\Entity\PaymentOption'); |
| 202 | 202 | }; |
| 203 | - $app['eccube.repository.category'] = function () use ($app) { |
|
| 203 | + $app['eccube.repository.category'] = function() use ($app) { |
|
| 204 | 204 | $CategoryRepository = $app['orm.em']->getRepository('Eccube\Entity\Category'); |
| 205 | 205 | $CategoryRepository->setApplication($app); |
| 206 | 206 | |
| 207 | 207 | return $CategoryRepository; |
| 208 | 208 | }; |
| 209 | - $app['eccube.repository.customer'] = function () use ($app) { |
|
| 209 | + $app['eccube.repository.customer'] = function() use ($app) { |
|
| 210 | 210 | $customerRepository = $app['orm.em']->getRepository('Eccube\Entity\Customer'); |
| 211 | 211 | $customerRepository->setApplication($app); |
| 212 | 212 | return $customerRepository; |
| 213 | 213 | }; |
| 214 | - $app['eccube.repository.news'] = function () use ($app) { |
|
| 214 | + $app['eccube.repository.news'] = function() use ($app) { |
|
| 215 | 215 | return $app['orm.em']->getRepository('Eccube\Entity\News'); |
| 216 | 216 | }; |
| 217 | - $app['eccube.repository.mail_history'] = function () use ($app) { |
|
| 217 | + $app['eccube.repository.mail_history'] = function() use ($app) { |
|
| 218 | 218 | return $app['orm.em']->getRepository('Eccube\Entity\MailHistory'); |
| 219 | 219 | }; |
| 220 | - $app['eccube.repository.member'] = function () use ($app) { |
|
| 220 | + $app['eccube.repository.member'] = function() use ($app) { |
|
| 221 | 221 | $memberRepository = $app['orm.em']->getRepository('Eccube\Entity\Member'); |
| 222 | 222 | $memberRepository->setEncoderFactorty($app['security.encoder_factory']); |
| 223 | 223 | return $memberRepository; |
| 224 | 224 | }; |
| 225 | - $app['eccube.repository.order'] = function () use ($app) { |
|
| 225 | + $app['eccube.repository.order'] = function() use ($app) { |
|
| 226 | 226 | return $app['orm.em']->getRepository('Eccube\Entity\Order'); |
| 227 | 227 | }; |
| 228 | - $app['eccube.repository.product'] = function () use ($app) { |
|
| 228 | + $app['eccube.repository.product'] = function() use ($app) { |
|
| 229 | 229 | $productRepository = $app['orm.em']->getRepository('Eccube\Entity\Product'); |
| 230 | 230 | $productRepository->setApplication($app); |
| 231 | 231 | |
| 232 | 232 | return $productRepository; |
| 233 | 233 | }; |
| 234 | - $app['eccube.repository.product_image'] = function () use ($app) { |
|
| 234 | + $app['eccube.repository.product_image'] = function() use ($app) { |
|
| 235 | 235 | return $app['orm.em']->getRepository('Eccube\Entity\ProductImage'); |
| 236 | 236 | }; |
| 237 | - $app['eccube.repository.product_class'] = function () use ($app) { |
|
| 237 | + $app['eccube.repository.product_class'] = function() use ($app) { |
|
| 238 | 238 | return $app['orm.em']->getRepository('Eccube\Entity\ProductClass'); |
| 239 | 239 | }; |
| 240 | - $app['eccube.repository.product_stock'] = function () use ($app) { |
|
| 240 | + $app['eccube.repository.product_stock'] = function() use ($app) { |
|
| 241 | 241 | return $app['orm.em']->getRepository('Eccube\Entity\ProductStock'); |
| 242 | 242 | }; |
| 243 | - $app['eccube.repository.product_tag'] = function () use ($app) { |
|
| 243 | + $app['eccube.repository.product_tag'] = function() use ($app) { |
|
| 244 | 244 | return $app['orm.em']->getRepository('Eccube\Entity\ProductTag'); |
| 245 | 245 | }; |
| 246 | - $app['eccube.repository.class_name'] = function () use ($app) { |
|
| 246 | + $app['eccube.repository.class_name'] = function() use ($app) { |
|
| 247 | 247 | return $app['orm.em']->getRepository('Eccube\Entity\ClassName'); |
| 248 | 248 | }; |
| 249 | - $app['eccube.repository.class_category'] = function () use ($app) { |
|
| 249 | + $app['eccube.repository.class_category'] = function() use ($app) { |
|
| 250 | 250 | return $app['orm.em']->getRepository('Eccube\Entity\ClassCategory'); |
| 251 | 251 | }; |
| 252 | - $app['eccube.repository.customer_favorite_product'] = function () use ($app) { |
|
| 252 | + $app['eccube.repository.customer_favorite_product'] = function() use ($app) { |
|
| 253 | 253 | return $app['orm.em']->getRepository('Eccube\Entity\CustomerFavoriteProduct'); |
| 254 | 254 | }; |
| 255 | - $app['eccube.repository.base_info'] = function () use ($app) { |
|
| 255 | + $app['eccube.repository.base_info'] = function() use ($app) { |
|
| 256 | 256 | $BaseInfoRepository = $app['orm.em']->getRepository('Eccube\Entity\BaseInfo'); |
| 257 | 257 | $BaseInfoRepository->setApplication($app); |
| 258 | 258 | |
| 259 | 259 | return $BaseInfoRepository; |
| 260 | 260 | }; |
| 261 | - $app['eccube.repository.tax_rule'] = function () use ($app) { |
|
| 261 | + $app['eccube.repository.tax_rule'] = function() use ($app) { |
|
| 262 | 262 | $taxRuleRepository = $app['orm.em']->getRepository('Eccube\Entity\TaxRule'); |
| 263 | 263 | $taxRuleRepository->setApplication($app); |
| 264 | 264 | |
| 265 | 265 | return $taxRuleRepository; |
| 266 | 266 | }; |
| 267 | - $app['eccube.repository.page_layout'] = function () use ($app) { |
|
| 267 | + $app['eccube.repository.page_layout'] = function() use ($app) { |
|
| 268 | 268 | $pageLayoutRepository = $app['orm.em']->getRepository('Eccube\Entity\PageLayout'); |
| 269 | 269 | $pageLayoutRepository->setApplication($app); |
| 270 | 270 | |
| 271 | 271 | return $pageLayoutRepository; |
| 272 | 272 | }; |
| 273 | - $app['eccube.repository.block'] = function () use ($app) { |
|
| 273 | + $app['eccube.repository.block'] = function() use ($app) { |
|
| 274 | 274 | $blockRepository = $app['orm.em']->getRepository('Eccube\Entity\Block'); |
| 275 | 275 | $blockRepository->setApplication($app); |
| 276 | 276 | |
| 277 | 277 | return $blockRepository; |
| 278 | 278 | }; |
| 279 | - $app['eccube.repository.order'] = function () use ($app) { |
|
| 279 | + $app['eccube.repository.order'] = function() use ($app) { |
|
| 280 | 280 | $orderRepository = $app['orm.em']->getRepository('Eccube\Entity\Order'); |
| 281 | 281 | $orderRepository->setApplication($app); |
| 282 | 282 | |
| 283 | 283 | return $orderRepository; |
| 284 | 284 | }; |
| 285 | - $app['eccube.repository.customer_address'] = function () use ($app) { |
|
| 285 | + $app['eccube.repository.customer_address'] = function() use ($app) { |
|
| 286 | 286 | return $app['orm.em']->getRepository('Eccube\Entity\CustomerAddress'); |
| 287 | 287 | }; |
| 288 | - $app['eccube.repository.shipping'] = function () use ($app) { |
|
| 288 | + $app['eccube.repository.shipping'] = function() use ($app) { |
|
| 289 | 289 | return $app['orm.em']->getRepository('Eccube\Entity\Shipping'); |
| 290 | 290 | }; |
| 291 | - $app['eccube.repository.shipment_item'] = function () use ($app) { |
|
| 291 | + $app['eccube.repository.shipment_item'] = function() use ($app) { |
|
| 292 | 292 | return $app['orm.em']->getRepository('Eccube\Entity\ShipmentItem'); |
| 293 | 293 | }; |
| 294 | - $app['eccube.repository.customer_status'] = function () use ($app) { |
|
| 294 | + $app['eccube.repository.customer_status'] = function() use ($app) { |
|
| 295 | 295 | return $app['orm.em']->getRepository('Eccube\Entity\Master\CustomerStatus'); |
| 296 | 296 | }; |
| 297 | - $app['eccube.repository.order_status'] = function () use ($app) { |
|
| 297 | + $app['eccube.repository.order_status'] = function() use ($app) { |
|
| 298 | 298 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus'); |
| 299 | 299 | }; |
| 300 | - $app['eccube.repository.mail_template'] = function () use ($app) { |
|
| 300 | + $app['eccube.repository.mail_template'] = function() use ($app) { |
|
| 301 | 301 | return $app['orm.em']->getRepository('Eccube\Entity\MailTemplate'); |
| 302 | 302 | }; |
| 303 | - $app['eccube.repository.csv'] = function () use ($app) { |
|
| 303 | + $app['eccube.repository.csv'] = function() use ($app) { |
|
| 304 | 304 | return $app['orm.em']->getRepository('Eccube\Entity\Csv'); |
| 305 | 305 | }; |
| 306 | - $app['eccube.repository.template'] = function () use ($app) { |
|
| 306 | + $app['eccube.repository.template'] = function() use ($app) { |
|
| 307 | 307 | return $app['orm.em']->getRepository('Eccube\Entity\Template'); |
| 308 | 308 | }; |
| 309 | - $app['eccube.repository.authority_role'] = function () use ($app) { |
|
| 309 | + $app['eccube.repository.authority_role'] = function() use ($app) { |
|
| 310 | 310 | return $app['orm.em']->getRepository('Eccube\Entity\AuthorityRole'); |
| 311 | 311 | }; |
| 312 | 312 | |
| 313 | - $app['paginator'] = $app->protect(function () { |
|
| 313 | + $app['paginator'] = $app->protect(function() { |
|
| 314 | 314 | $paginator = new \Knp\Component\Pager\Paginator(); |
| 315 | 315 | $paginator->subscribe(new \Eccube\EventListener\PaginatorListener()); |
| 316 | 316 | |
| 317 | 317 | return $paginator; |
| 318 | 318 | }); |
| 319 | 319 | |
| 320 | - $app['eccube.repository.help'] = function () use ($app) { |
|
| 320 | + $app['eccube.repository.help'] = function() use ($app) { |
|
| 321 | 321 | return $app['orm.em']->getRepository('Eccube\Entity\Help'); |
| 322 | 322 | }; |
| 323 | - $app['eccube.repository.plugin'] = function () use ($app) { |
|
| 323 | + $app['eccube.repository.plugin'] = function() use ($app) { |
|
| 324 | 324 | return $app['orm.em']->getRepository('Eccube\Entity\Plugin'); |
| 325 | 325 | }; |
| 326 | - $app['eccube.repository.plugin_event_handler'] = function () use ($app) { |
|
| 326 | + $app['eccube.repository.plugin_event_handler'] = function() use ($app) { |
|
| 327 | 327 | return $app['orm.em']->getRepository('Eccube\Entity\PluginEventHandler'); |
| 328 | 328 | }; |
| 329 | - $app['eccube.repository.layout'] = function () use ($app) { |
|
| 329 | + $app['eccube.repository.layout'] = function() use ($app) { |
|
| 330 | 330 | return $app['orm.em']->getRepository('Eccube\Entity\Layout'); |
| 331 | 331 | }; |
| 332 | 332 | |
| 333 | - $app['request_scope'] = function () { |
|
| 333 | + $app['request_scope'] = function() { |
|
| 334 | 334 | return new ParameterBag(); |
| 335 | 335 | }; |
| 336 | 336 | // TODO 使用するか検討 |
| 337 | - $app['eccube.twig.node.hello'] = $app->protect(function ($node, $compiler) { |
|
| 337 | + $app['eccube.twig.node.hello'] = $app->protect(function($node, $compiler) { |
|
| 338 | 338 | $compiler |
| 339 | 339 | ->addDebugInfo($node) |
| 340 | 340 | ->write("echo 'Helloooooo ' . ") |
@@ -344,7 +344,7 @@ discard block |
||
| 344 | 344 | |
| 345 | 345 | }); |
| 346 | 346 | // TODO 使用するか検討 |
| 347 | - $app['eccube.twig.node.jiro'] = $app->protect(function ($node, $compiler) { |
|
| 347 | + $app['eccube.twig.node.jiro'] = $app->protect(function($node, $compiler) { |
|
| 348 | 348 | $compiler |
| 349 | 349 | ->addDebugInfo($node) |
| 350 | 350 | ->write("echo 'jirooooooo ' . ") |
@@ -355,7 +355,7 @@ discard block |
||
| 355 | 355 | }); |
| 356 | 356 | |
| 357 | 357 | // TODO 使用するか検討 |
| 358 | - $app['eccube.twig.generic_node_names'] = function () use ($app) { |
|
| 358 | + $app['eccube.twig.generic_node_names'] = function() use ($app) { |
|
| 359 | 359 | return [ |
| 360 | 360 | 'hello', |
| 361 | 361 | 'jiro', |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | }; |
| 365 | 365 | |
| 366 | 366 | // TODO 使用するか検討 |
| 367 | - $app['twig_parsers'] = function () use ($app) { |
|
| 367 | + $app['twig_parsers'] = function() use ($app) { |
|
| 368 | 368 | $GenericTokenParsers = []; |
| 369 | 369 | foreach ($app['eccube.twig.generic_node_names'] as $tagName) { |
| 370 | 370 | $GenericTokenParsers[] = new \Eccube\Twig\Extension\GenericTokenParser($app, $tagName); |
@@ -373,20 +373,20 @@ discard block |
||
| 373 | 373 | }; |
| 374 | 374 | |
| 375 | 375 | // TODO ServiceProvider から追加できるよう Collection にする |
| 376 | - $app['eccube.twig.block.templates'] = function () { |
|
| 376 | + $app['eccube.twig.block.templates'] = function() { |
|
| 377 | 377 | return [ |
| 378 | 378 | 'render_block.twig', |
| 379 | 379 | ]; |
| 380 | 380 | }; |
| 381 | 381 | |
| 382 | 382 | // Form\Type |
| 383 | - $app->extend('form.type.extensions', function ($extensions) use ($app) { |
|
| 383 | + $app->extend('form.type.extensions', function($extensions) use ($app) { |
|
| 384 | 384 | $extensions[] = new \Eccube\Form\Extension\HelpTypeExtension(); |
| 385 | 385 | $extensions[] = new \Eccube\Form\Extension\FreezeTypeExtension(); |
| 386 | 386 | $extensions[] = new \Eccube\Form\Extension\DoctrineOrmExtension($app['orm.em']); |
| 387 | 387 | return $extensions; |
| 388 | 388 | }); |
| 389 | - $app->extend('form.types', function ($types) use ($app) { |
|
| 389 | + $app->extend('form.types', function($types) use ($app) { |
|
| 390 | 390 | $types[] = new \Eccube\Form\Type\NameType($app['config']); |
| 391 | 391 | $types[] = new \Eccube\Form\Type\KanaType($app['config']); |
| 392 | 392 | $types[] = new \Eccube\Form\Type\TelType($app['config']); |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | return $types; |
| 490 | 490 | }); |
| 491 | 491 | $app['eccube.entity.event.dispatcher']->addEventListener(new \Acme\Entity\SoldOutEventListener()); |
| 492 | - $app['eccube.queries'] = function () { |
|
| 492 | + $app['eccube.queries'] = function() { |
|
| 493 | 493 | return new \Eccube\Doctrine\Query\Queries(); |
| 494 | 494 | }; |
| 495 | 495 | // TODO QueryCustomizerの追加方法は要検討 |