@@ -31,8 +31,6 @@ discard block |
||
| 31 | 31 | use Eccube\Common\Constant; |
| 32 | 32 | use Eccube\Doctrine\DBAL\Types\UTCDateTimeType; |
| 33 | 33 | use Eccube\Doctrine\ORM\Mapping\Driver\AnnotationDriver; |
| 34 | -use Eccube\Doctrine\ORM\Mapping\Driver\YamlDriver; |
|
| 35 | -use Eccube\EventListener\TransactionListener; |
|
| 36 | 34 | use Eccube\Plugin\ConfigManager as PluginConfigManager; |
| 37 | 35 | use Eccube\Routing\EccubeRouter; |
| 38 | 36 | use Eccube\ServiceProvider\MobileDetectServiceProvider; |
@@ -43,13 +41,11 @@ discard block |
||
| 43 | 41 | use Sergiors\Silex\Provider\TemplatingServiceProvider; |
| 44 | 42 | use Sergiors\Silex\Routing\ChainUrlGenerator; |
| 45 | 43 | use Sergiors\Silex\Routing\ChainUrlMatcher; |
| 46 | -use Symfony\Component\EventDispatcher\EventDispatcher; |
|
| 47 | 44 | use Symfony\Component\Finder\Finder; |
| 48 | 45 | use Symfony\Component\HttpFoundation\Request; |
| 49 | 46 | use Symfony\Component\HttpFoundation\Response; |
| 50 | 47 | use Symfony\Component\HttpKernel\Event\FilterResponseEvent; |
| 51 | 48 | use Symfony\Component\HttpKernel\Event\GetResponseEvent; |
| 52 | -use Symfony\Component\HttpKernel\Event\PostResponseEvent; |
|
| 53 | 49 | use Symfony\Component\HttpKernel\KernelEvents; |
| 54 | 50 | use Symfony\Component\Yaml\Yaml; |
| 55 | 51 | |
@@ -543,13 +543,13 @@ |
||
| 543 | 543 | $pluginConfigs = PluginConfigManager::getPluginConfigAll($this['debug']); |
| 544 | 544 | $ormMappings = array(); |
| 545 | 545 | $ormMappings[] = array( |
| 546 | - 'type' => 'annotation', |
|
| 547 | - 'namespace' => 'Eccube\Entity', |
|
| 548 | - 'path' => array( |
|
| 549 | - __DIR__.'/Entity' |
|
| 550 | - ), |
|
| 551 | - 'use_simple_annotation_reader' => false, |
|
| 552 | - ); |
|
| 546 | + 'type' => 'annotation', |
|
| 547 | + 'namespace' => 'Eccube\Entity', |
|
| 548 | + 'path' => array( |
|
| 549 | + __DIR__.'/Entity' |
|
| 550 | + ), |
|
| 551 | + 'use_simple_annotation_reader' => false, |
|
| 552 | + ); |
|
| 553 | 553 | |
| 554 | 554 | // TODO namespace は暫定 |
| 555 | 555 | $ormMappings[] = array( |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $this->register(new \Saxulum\Validator\Provider\SaxulumValidatorProvider()); |
| 170 | 170 | $this->register(new MobileDetectServiceProvider()); |
| 171 | 171 | |
| 172 | - $this->error(function (\Exception $e, Request $request, $code) { |
|
| 172 | + $this->error(function(\Exception $e, Request $request, $code) { |
|
| 173 | 173 | if ($this['debug']) { |
| 174 | 174 | return; |
| 175 | 175 | } |
@@ -263,14 +263,14 @@ discard block |
||
| 263 | 263 | return $router; |
| 264 | 264 | }); |
| 265 | 265 | |
| 266 | - $this['eccube.router.origin'] = function ($app) { |
|
| 266 | + $this['eccube.router.origin'] = function($app) { |
|
| 267 | 267 | $resource = __DIR__.'/Controller'; |
| 268 | 268 | $cachePrefix = 'Origin'; |
| 269 | 269 | |
| 270 | 270 | return $app['eccube.router']($resource, $cachePrefix); |
| 271 | 271 | }; |
| 272 | 272 | |
| 273 | - $this['eccube.routers.plugin'] = function ($app) { |
|
| 273 | + $this['eccube.routers.plugin'] = function($app) { |
|
| 274 | 274 | // TODO 有効なプラグインを対象とする必要がある. |
| 275 | 275 | $dirs = Finder::create() |
| 276 | 276 | ->in($app['config']['root_dir'].'/app/Plugin') |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | return $routers; |
| 288 | 288 | }; |
| 289 | 289 | |
| 290 | - $this['eccube.router.extend'] = function ($app) { |
|
| 290 | + $this['eccube.router.extend'] = function($app) { |
|
| 291 | 291 | // TODO ディレクトリ名は暫定 |
| 292 | 292 | $resource = $app['config']['root_dir'].'/app/Acme/Controller'; |
| 293 | 293 | $cachePrefix = 'Extend'; |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | return $router; |
| 298 | 298 | }; |
| 299 | 299 | |
| 300 | - $this->extend('request_matcher', function ($matcher, $app) { |
|
| 300 | + $this->extend('request_matcher', function($matcher, $app) { |
|
| 301 | 301 | $matchers = []; |
| 302 | 302 | $matchers[] = $app['eccube.router.extend']; |
| 303 | 303 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | return new ChainUrlMatcher($matchers, $app['request_context']); |
| 310 | 310 | }); |
| 311 | 311 | |
| 312 | - $this->extend('url_generator', function ($generator, $app) { |
|
| 312 | + $this->extend('url_generator', function($generator, $app) { |
|
| 313 | 313 | $generators = []; |
| 314 | 314 | $generators[] = $app['eccube.router.extend']; |
| 315 | 315 | foreach ($app['eccube.routers.plugin'] as $router) { |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | 'translator.cache_dir' => $this['debug'] ? null : $this['config']['root_dir'].'/app/cache/translator', |
| 341 | 341 | 'locale_fallbacks' => ['ja', 'en'], |
| 342 | 342 | )); |
| 343 | - $this->extend('translator', function ($translator, \Silex\Application $app) { |
|
| 343 | + $this->extend('translator', function($translator, \Silex\Application $app) { |
|
| 344 | 344 | $translator->addLoader('yaml', new \Symfony\Component\Translation\Loader\YamlFileLoader()); |
| 345 | 345 | |
| 346 | 346 | $file = __DIR__.'/Resource/locale/validator.'.$app['locale'].'.yml'; |
@@ -387,14 +387,14 @@ discard block |
||
| 387 | 387 | $this->register(new \Silex\Provider\TwigServiceProvider(), array( |
| 388 | 388 | 'twig.form.templates' => array('Form/form_layout.twig'), |
| 389 | 389 | )); |
| 390 | - $this->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
| 390 | + $this->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
| 391 | 391 | $twig->addExtension(new \Eccube\Twig\Extension\EccubeExtension($app)); |
| 392 | 392 | $twig->addExtension(new \Twig_Extension_StringLoader()); |
| 393 | 393 | |
| 394 | 394 | return $twig; |
| 395 | 395 | }); |
| 396 | 396 | |
| 397 | - $this->before(function (Request $request, \Silex\Application $app) { |
|
| 397 | + $this->before(function(Request $request, \Silex\Application $app) { |
|
| 398 | 398 | $app['admin'] = $app['front'] = false; |
| 399 | 399 | $pathinfo = rawurldecode($request->getPathInfo()); |
| 400 | 400 | if (strpos($pathinfo, '/'.trim($app['config']['admin_route'], '/').'/') === 0) { |
@@ -410,14 +410,14 @@ discard block |
||
| 410 | 410 | } |
| 411 | 411 | $paths[] = $app['config']['template_admin_realdir']; |
| 412 | 412 | $paths[] = __DIR__.'/../../app/Plugin'; |
| 413 | - $cacheDir = __DIR__.'/../../app/cache/twig/admin'; |
|
| 413 | + $cacheDir = __DIR__.'/../../app/cache/twig/admin'; |
|
| 414 | 414 | } else { |
| 415 | 415 | if (file_exists($app['config']['template_realdir'])) { |
| 416 | 416 | $paths[] = $app['config']['template_realdir']; |
| 417 | 417 | } |
| 418 | 418 | $paths[] = $app['config']['template_default_realdir']; |
| 419 | 419 | $paths[] = __DIR__.'/../../app/Plugin'; |
| 420 | - $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
|
| 420 | + $cacheDir = __DIR__.'/../../app/cache/twig/'.$app['config']['template_code']; |
|
| 421 | 421 | } |
| 422 | 422 | $app['twig']->setCache($app['debug'] ? null : $cacheDir); |
| 423 | 423 | $app['twig.loader']->addLoader(new \Twig_Loader_Filesystem($paths)); |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | }, self::EARLY_EVENT); |
| 436 | 436 | |
| 437 | 437 | // twigのグローバル変数を定義. |
| 438 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
| 438 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) { |
|
| 439 | 439 | // 未ログイン時にマイページや管理画面以下にアクセスするとSubRequestで実行されるため, |
| 440 | 440 | // $event->isMasterRequest()ではなく、グローバル変数が初期化済かどうかの判定を行う |
| 441 | 441 | if (isset($this['twig_global_initialized']) && $this['twig_global_initialized'] === true) { |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | // メール送信時の文字エンコード指定(デフォルトはUTF-8) |
| 503 | 503 | if (isset($this['config']['mail']['charset_iso_2022_jp']) && is_bool($this['config']['mail']['charset_iso_2022_jp'])) { |
| 504 | 504 | if ($this['config']['mail']['charset_iso_2022_jp'] === true) { |
| 505 | - \Swift::init(function () { |
|
| 505 | + \Swift::init(function() { |
|
| 506 | 506 | \Swift_DependencyContainer::getInstance() |
| 507 | 507 | ->register('mime.qpheaderencoder') |
| 508 | 508 | ->asAliasOf('mime.base64headerencoder'); |
@@ -621,7 +621,7 @@ discard block |
||
| 621 | 621 | |
| 622 | 622 | $this->extend( |
| 623 | 623 | 'orm.em.config', |
| 624 | - function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
| 624 | + function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
| 625 | 625 | |
| 626 | 626 | /** @var $chain \Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain */ |
| 627 | 627 | $chain = $config->getMetadataDriverImpl(); |
@@ -643,7 +643,7 @@ discard block |
||
| 643 | 643 | } |
| 644 | 644 | ); |
| 645 | 645 | |
| 646 | - $this->extend('orm.em', function (\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
| 646 | + $this->extend('orm.em', function(\Doctrine\ORM\EntityManager $em, \Silex\Application $app) { |
|
| 647 | 647 | // tax_rule |
| 648 | 648 | $taxRuleRepository = $em->getRepository('Eccube\Entity\TaxRule'); |
| 649 | 649 | $taxRuleRepository->setApplication($app); |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | // second level cacheの設定. |
| 677 | 677 | $this->extend( |
| 678 | 678 | 'orm.em.config', |
| 679 | - function (\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
| 679 | + function(\Doctrine\ORM\Configuration $config, \Silex\Application $app) { |
|
| 680 | 680 | $config->setSecondLevelCacheEnabled(); |
| 681 | 681 | $cacheConfig = $config->getSecondLevelCacheConfiguration(); |
| 682 | 682 | $regionConfig = $cacheConfig->getRegionsConfiguration(); |
@@ -765,31 +765,31 @@ discard block |
||
| 765 | 765 | array('^/mypage', 'ROLE_USER', $channel), |
| 766 | 766 | ); |
| 767 | 767 | |
| 768 | - $this['eccube.password_encoder'] = function ($app) { |
|
| 768 | + $this['eccube.password_encoder'] = function($app) { |
|
| 769 | 769 | return new \Eccube\Security\Core\Encoder\PasswordEncoder($app['config']); |
| 770 | 770 | }; |
| 771 | - $this['security.encoder_factory'] = function ($app) { |
|
| 771 | + $this['security.encoder_factory'] = function($app) { |
|
| 772 | 772 | return new \Symfony\Component\Security\Core\Encoder\EncoderFactory(array( |
| 773 | 773 | 'Eccube\Entity\Customer' => $app['eccube.password_encoder'], |
| 774 | 774 | 'Eccube\Entity\Member' => $app['eccube.password_encoder'], |
| 775 | 775 | )); |
| 776 | 776 | }; |
| 777 | - $this['eccube.event_listner.security'] = function ($app) { |
|
| 777 | + $this['eccube.event_listner.security'] = function($app) { |
|
| 778 | 778 | return new \Eccube\EventListener\SecurityEventListener($app['orm.em']); |
| 779 | 779 | }; |
| 780 | 780 | |
| 781 | 781 | // Voterの設定 |
| 782 | - $this['authority_voter'] = function ($app) { |
|
| 782 | + $this['authority_voter'] = function($app) { |
|
| 783 | 783 | return new \Eccube\Security\Voter\AuthorityVoter($app); |
| 784 | 784 | }; |
| 785 | 785 | |
| 786 | - $this->extend('security.voters', function ($voters, \Silex\Application $app) { |
|
| 786 | + $this->extend('security.voters', function($voters, \Silex\Application $app) { |
|
| 787 | 787 | $voters[] = $app['authority_voter']; |
| 788 | 788 | |
| 789 | 789 | return $voters; |
| 790 | 790 | }); |
| 791 | 791 | |
| 792 | - $this['security.access_manager'] = function ($app) { |
|
| 792 | + $this['security.access_manager'] = function($app) { |
|
| 793 | 793 | return new \Symfony\Component\Security\Core\Authorization\AccessDecisionManager($app['security.voters'], 'unanimous'); |
| 794 | 794 | }; |
| 795 | 795 | |
@@ -803,7 +803,7 @@ discard block |
||
| 803 | 803 | { |
| 804 | 804 | $config = $this['config']; |
| 805 | 805 | if (isset($config['trusted_proxies_connection_only']) && !empty($config['trusted_proxies_connection_only'])) { |
| 806 | - $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($config) { |
|
| 806 | + $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($config) { |
|
| 807 | 807 | // サブリクエストのREMOTE_ADDRも動的に設定を行う必要があるため、KernelEvents::REQUESTを使用する |
| 808 | 808 | Request::setTrustedProxies(array_merge(array($event->getRequest()->server->get('REMOTE_ADDR')), $config['trusted_proxies'])); |
| 809 | 809 | }, self::EARLY_EVENT); |
@@ -969,7 +969,7 @@ discard block |
||
| 969 | 969 | $app = $this; |
| 970 | 970 | |
| 971 | 971 | // Response Event(http cache対応、event実行は一番遅く設定) |
| 972 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 972 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 973 | 973 | |
| 974 | 974 | if (!$event->isMasterRequest()) { |
| 975 | 975 | return; |
@@ -32,6 +32,9 @@ |
||
| 32 | 32 | { |
| 33 | 33 | protected $trait_proxies_directory; |
| 34 | 34 | |
| 35 | + /** |
|
| 36 | + * @param string $dir |
|
| 37 | + */ |
|
| 35 | 38 | public function setTraitProxiesDirectory($dir) |
| 36 | 39 | { |
| 37 | 40 | $this->trait_proxies_directory = $dir; |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | $includedFiles = []; |
| 55 | 55 | |
| 56 | 56 | foreach ($this->paths as $path) { |
| 57 | - if ( ! is_dir($path)) { |
|
| 57 | + if (!is_dir($path)) { |
|
| 58 | 58 | throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); |
| 59 | 59 | } |
| 60 | 60 | |
@@ -63,14 +63,14 @@ discard block |
||
| 63 | 63 | new \RecursiveDirectoryIterator($path, \FilesystemIterator::SKIP_DOTS), |
| 64 | 64 | \RecursiveIteratorIterator::LEAVES_ONLY |
| 65 | 65 | ), |
| 66 | - '/^.+' . preg_quote($this->fileExtension) . '$/i', |
|
| 66 | + '/^.+'.preg_quote($this->fileExtension).'$/i', |
|
| 67 | 67 | \RecursiveRegexIterator::GET_MATCH |
| 68 | 68 | ); |
| 69 | 69 | |
| 70 | 70 | foreach ($iterator as $file) { |
| 71 | 71 | $sourceFile = $file[0]; |
| 72 | 72 | |
| 73 | - if ( ! preg_match('(^phar:)i', $sourceFile)) { |
|
| 73 | + if (!preg_match('(^phar:)i', $sourceFile)) { |
|
| 74 | 74 | $sourceFile = realpath($sourceFile); |
| 75 | 75 | } |
| 76 | 76 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | foreach ($declared as $className) { |
| 102 | 102 | $rc = new \ReflectionClass($className); |
| 103 | 103 | $sourceFile = $rc->getFileName(); |
| 104 | - if (in_array($sourceFile, $includedFiles) && ! $this->isTransient($className)) { |
|
| 104 | + if (in_array($sourceFile, $includedFiles) && !$this->isTransient($className)) { |
|
| 105 | 105 | $classes[] = $className; |
| 106 | 106 | } |
| 107 | 107 | } |
@@ -38,7 +38,7 @@ |
||
| 38 | 38 | { |
| 39 | 39 | $builder->addEventListener( |
| 40 | 40 | FormEvents::PRE_SET_DATA, |
| 41 | - function (FormEvent $event) { |
|
| 41 | + function(FormEvent $event) { |
|
| 42 | 42 | $form = $event->getForm(); |
| 43 | 43 | $config = $form->getConfig(); |
| 44 | 44 | // data_classオプションが必要 |
@@ -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,202 +135,202 @@ 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 | return $app['orm.em']->getRepository('Eccube\Entity\Customer'); |
| 208 | 208 | }; |
| 209 | - $app['eccube.repository.news'] = function () use ($app) { |
|
| 209 | + $app['eccube.repository.news'] = function() use ($app) { |
|
| 210 | 210 | return $app['orm.em']->getRepository('Eccube\Entity\News'); |
| 211 | 211 | }; |
| 212 | - $app['eccube.repository.mail_history'] = function () use ($app) { |
|
| 212 | + $app['eccube.repository.mail_history'] = function() use ($app) { |
|
| 213 | 213 | return $app['orm.em']->getRepository('Eccube\Entity\MailHistory'); |
| 214 | 214 | }; |
| 215 | - $app['eccube.repository.member'] = function () use ($app) { |
|
| 215 | + $app['eccube.repository.member'] = function() use ($app) { |
|
| 216 | 216 | $memberRepository = $app['orm.em']->getRepository('Eccube\Entity\Member'); |
| 217 | 217 | $memberRepository->setEncoderFactorty($app['security.encoder_factory']); |
| 218 | 218 | return $memberRepository; |
| 219 | 219 | }; |
| 220 | - $app['eccube.repository.order'] = function () use ($app) { |
|
| 220 | + $app['eccube.repository.order'] = function() use ($app) { |
|
| 221 | 221 | return $app['orm.em']->getRepository('Eccube\Entity\Order'); |
| 222 | 222 | }; |
| 223 | - $app['eccube.repository.product'] = function () use ($app) { |
|
| 223 | + $app['eccube.repository.product'] = function() use ($app) { |
|
| 224 | 224 | $productRepository = $app['orm.em']->getRepository('Eccube\Entity\Product'); |
| 225 | 225 | $productRepository->setApplication($app); |
| 226 | 226 | |
| 227 | 227 | return $productRepository; |
| 228 | 228 | }; |
| 229 | - $app['eccube.repository.product_image'] = function () use ($app) { |
|
| 229 | + $app['eccube.repository.product_image'] = function() use ($app) { |
|
| 230 | 230 | return $app['orm.em']->getRepository('Eccube\Entity\ProductImage'); |
| 231 | 231 | }; |
| 232 | - $app['eccube.repository.product_class'] = function () use ($app) { |
|
| 232 | + $app['eccube.repository.product_class'] = function() use ($app) { |
|
| 233 | 233 | return $app['orm.em']->getRepository('Eccube\Entity\ProductClass'); |
| 234 | 234 | }; |
| 235 | - $app['eccube.repository.product_stock'] = function () use ($app) { |
|
| 235 | + $app['eccube.repository.product_stock'] = function() use ($app) { |
|
| 236 | 236 | return $app['orm.em']->getRepository('Eccube\Entity\ProductStock'); |
| 237 | 237 | }; |
| 238 | - $app['eccube.repository.product_tag'] = function () use ($app) { |
|
| 238 | + $app['eccube.repository.product_tag'] = function() use ($app) { |
|
| 239 | 239 | return $app['orm.em']->getRepository('Eccube\Entity\ProductTag'); |
| 240 | 240 | }; |
| 241 | - $app['eccube.repository.class_name'] = function () use ($app) { |
|
| 241 | + $app['eccube.repository.class_name'] = function() use ($app) { |
|
| 242 | 242 | return $app['orm.em']->getRepository('Eccube\Entity\ClassName'); |
| 243 | 243 | }; |
| 244 | - $app['eccube.repository.class_category'] = function () use ($app) { |
|
| 244 | + $app['eccube.repository.class_category'] = function() use ($app) { |
|
| 245 | 245 | return $app['orm.em']->getRepository('Eccube\Entity\ClassCategory'); |
| 246 | 246 | }; |
| 247 | - $app['eccube.repository.customer_favorite_product'] = function () use ($app) { |
|
| 247 | + $app['eccube.repository.customer_favorite_product'] = function() use ($app) { |
|
| 248 | 248 | return $app['orm.em']->getRepository('Eccube\Entity\CustomerFavoriteProduct'); |
| 249 | 249 | }; |
| 250 | - $app['eccube.repository.base_info'] = function () use ($app) { |
|
| 250 | + $app['eccube.repository.base_info'] = function() use ($app) { |
|
| 251 | 251 | $BaseInfoRepository = $app['orm.em']->getRepository('Eccube\Entity\BaseInfo'); |
| 252 | 252 | $BaseInfoRepository->setApplication($app); |
| 253 | 253 | |
| 254 | 254 | return $BaseInfoRepository; |
| 255 | 255 | }; |
| 256 | - $app['eccube.repository.tax_rule'] = function () use ($app) { |
|
| 256 | + $app['eccube.repository.tax_rule'] = function() use ($app) { |
|
| 257 | 257 | $taxRuleRepository = $app['orm.em']->getRepository('Eccube\Entity\TaxRule'); |
| 258 | 258 | $taxRuleRepository->setApplication($app); |
| 259 | 259 | |
| 260 | 260 | return $taxRuleRepository; |
| 261 | 261 | }; |
| 262 | - $app['eccube.repository.page_layout'] = function () use ($app) { |
|
| 262 | + $app['eccube.repository.page_layout'] = function() use ($app) { |
|
| 263 | 263 | $pageLayoutRepository = $app['orm.em']->getRepository('Eccube\Entity\PageLayout'); |
| 264 | 264 | $pageLayoutRepository->setApplication($app); |
| 265 | 265 | |
| 266 | 266 | return $pageLayoutRepository; |
| 267 | 267 | }; |
| 268 | - $app['eccube.repository.block'] = function () use ($app) { |
|
| 268 | + $app['eccube.repository.block'] = function() use ($app) { |
|
| 269 | 269 | $blockRepository = $app['orm.em']->getRepository('Eccube\Entity\Block'); |
| 270 | 270 | $blockRepository->setApplication($app); |
| 271 | 271 | |
| 272 | 272 | return $blockRepository; |
| 273 | 273 | }; |
| 274 | - $app['eccube.repository.order'] = function () use ($app) { |
|
| 274 | + $app['eccube.repository.order'] = function() use ($app) { |
|
| 275 | 275 | $orderRepository = $app['orm.em']->getRepository('Eccube\Entity\Order'); |
| 276 | 276 | $orderRepository->setApplication($app); |
| 277 | 277 | |
| 278 | 278 | return $orderRepository; |
| 279 | 279 | }; |
| 280 | - $app['eccube.repository.customer_address'] = function () use ($app) { |
|
| 280 | + $app['eccube.repository.customer_address'] = function() use ($app) { |
|
| 281 | 281 | return $app['orm.em']->getRepository('Eccube\Entity\CustomerAddress'); |
| 282 | 282 | }; |
| 283 | - $app['eccube.repository.shipping'] = function () use ($app) { |
|
| 283 | + $app['eccube.repository.shipping'] = function() use ($app) { |
|
| 284 | 284 | return $app['orm.em']->getRepository('Eccube\Entity\Shipping'); |
| 285 | 285 | }; |
| 286 | - $app['eccube.repository.customer_status'] = function () use ($app) { |
|
| 286 | + $app['eccube.repository.customer_status'] = function() use ($app) { |
|
| 287 | 287 | return $app['orm.em']->getRepository('Eccube\Entity\Master\CustomerStatus'); |
| 288 | 288 | }; |
| 289 | - $app['eccube.repository.order_status'] = function () use ($app) { |
|
| 289 | + $app['eccube.repository.order_status'] = function() use ($app) { |
|
| 290 | 290 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus'); |
| 291 | 291 | }; |
| 292 | - $app['eccube.repository.mail_template'] = function () use ($app) { |
|
| 292 | + $app['eccube.repository.mail_template'] = function() use ($app) { |
|
| 293 | 293 | return $app['orm.em']->getRepository('Eccube\Entity\MailTemplate'); |
| 294 | 294 | }; |
| 295 | - $app['eccube.repository.csv'] = function () use ($app) { |
|
| 295 | + $app['eccube.repository.csv'] = function() use ($app) { |
|
| 296 | 296 | return $app['orm.em']->getRepository('Eccube\Entity\Csv'); |
| 297 | 297 | }; |
| 298 | - $app['eccube.repository.template'] = function () use ($app) { |
|
| 298 | + $app['eccube.repository.template'] = function() use ($app) { |
|
| 299 | 299 | return $app['orm.em']->getRepository('Eccube\Entity\Template'); |
| 300 | 300 | }; |
| 301 | - $app['eccube.repository.authority_role'] = function () use ($app) { |
|
| 301 | + $app['eccube.repository.authority_role'] = function() use ($app) { |
|
| 302 | 302 | return $app['orm.em']->getRepository('Eccube\Entity\AuthorityRole'); |
| 303 | 303 | }; |
| 304 | 304 | |
| 305 | - $app['paginator'] = $app->protect(function () { |
|
| 305 | + $app['paginator'] = $app->protect(function() { |
|
| 306 | 306 | $paginator = new \Knp\Component\Pager\Paginator(); |
| 307 | 307 | $paginator->subscribe(new \Eccube\EventListener\PaginatorListener()); |
| 308 | 308 | |
| 309 | 309 | return $paginator; |
| 310 | 310 | }); |
| 311 | 311 | |
| 312 | - $app['eccube.repository.help'] = function () use ($app) { |
|
| 312 | + $app['eccube.repository.help'] = function() use ($app) { |
|
| 313 | 313 | return $app['orm.em']->getRepository('Eccube\Entity\Help'); |
| 314 | 314 | }; |
| 315 | - $app['eccube.repository.plugin'] = function () use ($app) { |
|
| 315 | + $app['eccube.repository.plugin'] = function() use ($app) { |
|
| 316 | 316 | return $app['orm.em']->getRepository('Eccube\Entity\Plugin'); |
| 317 | 317 | }; |
| 318 | - $app['eccube.repository.plugin_event_handler'] = function () use ($app) { |
|
| 318 | + $app['eccube.repository.plugin_event_handler'] = function() use ($app) { |
|
| 319 | 319 | return $app['orm.em']->getRepository('Eccube\Entity\PluginEventHandler'); |
| 320 | 320 | }; |
| 321 | 321 | |
| 322 | - $app['request_scope'] = function () { |
|
| 322 | + $app['request_scope'] = function() { |
|
| 323 | 323 | return new ParameterBag(); |
| 324 | 324 | }; |
| 325 | 325 | |
| 326 | 326 | // Form\Type |
| 327 | - $app->extend('form.type.extensions', function ($extensions) use ($app) { |
|
| 327 | + $app->extend('form.type.extensions', function($extensions) use ($app) { |
|
| 328 | 328 | $extensions[] = new \Eccube\Form\Extension\HelpTypeExtension(); |
| 329 | 329 | $extensions[] = new \Eccube\Form\Extension\FreezeTypeExtension(); |
| 330 | 330 | $extensions[] = new \Eccube\Form\Extension\DoctrineOrmExtension(); |
| 331 | 331 | return $extensions; |
| 332 | 332 | }); |
| 333 | - $app->extend('form.types', function ($types) use ($app) { |
|
| 333 | + $app->extend('form.types', function($types) use ($app) { |
|
| 334 | 334 | $types[] = new \Eccube\Form\Type\NameType($app['config']); |
| 335 | 335 | $types[] = new \Eccube\Form\Type\KanaType($app['config']); |
| 336 | 336 | $types[] = new \Eccube\Form\Type\TelType($app['config']); |