@@ -920,7 +920,7 @@ |
||
920 | 920 | |
921 | 921 | // 配送日数が設定されている |
922 | 922 | if ($deliveryDateFlag) { |
923 | - $period = new \DatePeriod ( |
|
923 | + $period = new \DatePeriod( |
|
924 | 924 | new \DateTime($minDate.' day'), |
925 | 925 | new \DateInterval('P1D'), |
926 | 926 | new \DateTime($minDate + $this->app['config']['deliv_date_end_max'].' day') |
@@ -336,10 +336,10 @@ |
||
336 | 336 | } |
337 | 337 | } |
338 | 338 | } else { |
339 | - $filter = function ($v) { |
|
339 | + $filter = function($v) { |
|
340 | 340 | return preg_match('/^ids\d+$/', $v); |
341 | 341 | }; |
342 | - $map = function ($v) { |
|
342 | + $map = function($v) { |
|
343 | 343 | return preg_replace('/[^\d+]/', '', $v); |
344 | 344 | }; |
345 | 345 | $keys = array_keys($request->query->all()); |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | // path.ymlの更新 |
23 | 23 | $app = Application::getInstance(); |
24 | - $file = $app['config']['root_dir'] . '/app/config/eccube/path.yml'; |
|
24 | + $file = $app['config']['root_dir'].'/app/config/eccube/path.yml'; |
|
25 | 25 | $config = Yaml::parse(file_get_contents($file)); |
26 | 26 | |
27 | 27 | if (!array_key_exists('public_path', $config)) { |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | $this->register(new \Eccube\ServiceProvider\ValidatorServiceProvider()); |
134 | 134 | |
135 | 135 | $app = $this; |
136 | - $this->error(function (\Exception $e, $code) use ($app) { |
|
136 | + $this->error(function(\Exception $e, $code) use ($app) { |
|
137 | 137 | if ($app['debug']) { |
138 | 138 | return; |
139 | 139 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | $this->register(new \Silex\Provider\TranslationServiceProvider(), array( |
198 | 198 | 'locale' => $this['config']['locale'], |
199 | 199 | )); |
200 | - $this['translator'] = $this->share($this->extend('translator', function ($translator, \Silex\Application $app) { |
|
200 | + $this['translator'] = $this->share($this->extend('translator', function($translator, \Silex\Application $app) { |
|
201 | 201 | $translator->addLoader('yaml', new \Symfony\Component\Translation\Loader\YamlFileLoader()); |
202 | 202 | |
203 | 203 | $r = new \ReflectionClass('Symfony\Component\Validator\Validator'); |
@@ -241,16 +241,16 @@ discard block |
||
241 | 241 | $this->register(new \Silex\Provider\TwigServiceProvider(), array( |
242 | 242 | 'twig.form.templates' => array('Form/form_layout.twig'), |
243 | 243 | )); |
244 | - $this['twig'] = $this->share($this->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
244 | + $this['twig'] = $this->share($this->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
245 | 245 | $twig->addExtension(new \Eccube\Twig\Extension\EccubeExtension($app)); |
246 | 246 | $twig->addExtension(new \Twig_Extension_StringLoader()); |
247 | 247 | |
248 | 248 | return $twig; |
249 | 249 | })); |
250 | 250 | |
251 | - $this->before(function (Request $request, \Silex\Application $app) { |
|
251 | + $this->before(function(Request $request, \Silex\Application $app) { |
|
252 | 252 | // フロント or 管理画面ごとにtwigの探索パスを切り替える. |
253 | - $app['twig'] = $app->share($app->extend('twig', function (\Twig_Environment $twig, \Silex\Application $app) { |
|
253 | + $app['twig'] = $app->share($app->extend('twig', function(\Twig_Environment $twig, \Silex\Application $app) { |
|
254 | 254 | $paths = array(); |
255 | 255 | |
256 | 256 | // 互換性がないのでprofiler とproduction 時のcacheを分離する |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | |
303 | 303 | // twigのグローバル変数を定義. |
304 | 304 | $app = $this; |
305 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) { |
|
305 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) { |
|
306 | 306 | // ショップ基本情報 |
307 | 307 | $BaseInfo = $app['eccube.repository.base_info']->get(); |
308 | 308 | $app['twig']->addGlobal('BaseInfo', $BaseInfo); |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | // メール送信時の文字エンコード指定(デフォルトはUTF-8) |
363 | 363 | if (isset($this['config']['mail']['charset_iso_2022_jp']) && is_bool($this['config']['mail']['charset_iso_2022_jp'])) { |
364 | 364 | if ($this['config']['mail']['charset_iso_2022_jp'] === true) { |
365 | - \Swift::init(function () { |
|
365 | + \Swift::init(function() { |
|
366 | 366 | \Swift_DependencyContainer::getInstance() |
367 | 367 | ->register('mime.qpheaderencoder') |
368 | 368 | ->asAliasOf('mime.base64headerencoder'); |
@@ -529,19 +529,19 @@ discard block |
||
529 | 529 | array('^/mypage', 'ROLE_USER'), |
530 | 530 | ); |
531 | 531 | |
532 | - $this['eccube.password_encoder'] = $this->share(function ($app) { |
|
532 | + $this['eccube.password_encoder'] = $this->share(function($app) { |
|
533 | 533 | return new \Eccube\Security\Core\Encoder\PasswordEncoder($app['config']); |
534 | 534 | }); |
535 | - $this['security.encoder_factory'] = $this->share(function ($app) { |
|
535 | + $this['security.encoder_factory'] = $this->share(function($app) { |
|
536 | 536 | return new \Symfony\Component\Security\Core\Encoder\EncoderFactory(array( |
537 | 537 | 'Eccube\Entity\Customer' => $app['eccube.password_encoder'], |
538 | 538 | 'Eccube\Entity\Member' => $app['eccube.password_encoder'], |
539 | 539 | )); |
540 | 540 | }); |
541 | - $this['eccube.event_listner.security'] = $this->share(function ($app) { |
|
541 | + $this['eccube.event_listner.security'] = $this->share(function($app) { |
|
542 | 542 | return new \Eccube\EventListener\SecurityEventListener($app['orm.em']); |
543 | 543 | }); |
544 | - $this['user'] = function ($app) { |
|
544 | + $this['user'] = function($app) { |
|
545 | 545 | $token = $app['security']->getToken(); |
546 | 546 | |
547 | 547 | return ($token !== null) ? $token->getUser() : null; |
@@ -552,17 +552,17 @@ discard block |
||
552 | 552 | |
553 | 553 | // Voterの設定 |
554 | 554 | $app = $this; |
555 | - $this['authority_voter'] = $this->share(function ($app) { |
|
555 | + $this['authority_voter'] = $this->share(function($app) { |
|
556 | 556 | return new \Eccube\Security\Voter\AuthorityVoter($app); |
557 | 557 | }); |
558 | 558 | |
559 | - $app['security.voters'] = $app->extend('security.voters', function ($voters) use ($app) { |
|
559 | + $app['security.voters'] = $app->extend('security.voters', function($voters) use ($app) { |
|
560 | 560 | $voters[] = $app['authority_voter']; |
561 | 561 | |
562 | 562 | return $voters; |
563 | 563 | }); |
564 | 564 | |
565 | - $this['security.access_manager'] = $this->share(function ($app) { |
|
565 | + $this['security.access_manager'] = $this->share(function($app) { |
|
566 | 566 | return new \Symfony\Component\Security\Core\Authorization\AccessDecisionManager($app['security.voters'], 'unanimous'); |
567 | 567 | }); |
568 | 568 | |
@@ -586,14 +586,14 @@ discard block |
||
586 | 586 | public function initPluginEventDispatcher() |
587 | 587 | { |
588 | 588 | // EventDispatcher |
589 | - $this['eccube.event.dispatcher'] = $this->share(function () { |
|
589 | + $this['eccube.event.dispatcher'] = $this->share(function() { |
|
590 | 590 | return new EventDispatcher(); |
591 | 591 | }); |
592 | 592 | |
593 | 593 | $app = $this; |
594 | 594 | |
595 | 595 | // hook point |
596 | - $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($app) { |
|
596 | + $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($app) { |
|
597 | 597 | if (!$event->isMasterRequest()) { |
598 | 598 | return; |
599 | 599 | } |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
602 | 602 | }, self::EARLY_EVENT); |
603 | 603 | |
604 | - $this->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($app) { |
|
604 | + $this->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($app) { |
|
605 | 605 | if (!$event->isMasterRequest()) { |
606 | 606 | return; |
607 | 607 | } |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
611 | 611 | }); |
612 | 612 | |
613 | - $this->on(KernelEvents::RESPONSE, function (FilterResponseEvent $event) use ($app) { |
|
613 | + $this->on(KernelEvents::RESPONSE, function(FilterResponseEvent $event) use ($app) { |
|
614 | 614 | if (!$event->isMasterRequest()) { |
615 | 615 | return; |
616 | 616 | } |
@@ -619,7 +619,7 @@ discard block |
||
619 | 619 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
620 | 620 | }); |
621 | 621 | |
622 | - $this->on(KernelEvents::RESPONSE, function (FilterResponseEvent $event) use ($app) { |
|
622 | + $this->on(KernelEvents::RESPONSE, function(FilterResponseEvent $event) use ($app) { |
|
623 | 623 | if (!$event->isMasterRequest()) { |
624 | 624 | return; |
625 | 625 | } |
@@ -627,19 +627,19 @@ discard block |
||
627 | 627 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
628 | 628 | }, self::LATE_EVENT); |
629 | 629 | |
630 | - $this->on(KernelEvents::TERMINATE, function (PostResponseEvent $event) use ($app) { |
|
630 | + $this->on(KernelEvents::TERMINATE, function(PostResponseEvent $event) use ($app) { |
|
631 | 631 | $route = $event->getRequest()->attributes->get('_route'); |
632 | 632 | $hookpoint = "eccube.event.controller.$route.finish"; |
633 | 633 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
634 | 634 | }); |
635 | 635 | |
636 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
636 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
637 | 637 | $route = $event->getRequest()->attributes->get('_route'); |
638 | 638 | $app['eccube.event.dispatcher']->dispatch('eccube.event.render.'.$route.'.before', $event); |
639 | 639 | }); |
640 | 640 | |
641 | 641 | // Request Event |
642 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::REQUEST, function (\Symfony\Component\HttpKernel\Event\GetResponseEvent $event) use ($app) { |
|
642 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::REQUEST, function(\Symfony\Component\HttpKernel\Event\GetResponseEvent $event) use ($app) { |
|
643 | 643 | |
644 | 644 | if (\Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { |
645 | 645 | return; |
@@ -670,7 +670,7 @@ discard block |
||
670 | 670 | }, 30); // Routing(32)が解決しし, 認証判定(8)が実行される前のタイミング. |
671 | 671 | |
672 | 672 | // Controller Event |
673 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) { |
|
673 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) { |
|
674 | 674 | |
675 | 675 | if (\Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { |
676 | 676 | return; |
@@ -701,7 +701,7 @@ discard block |
||
701 | 701 | }); |
702 | 702 | |
703 | 703 | // Response Event |
704 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
704 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
705 | 705 | |
706 | 706 | if (\Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { |
707 | 707 | return; |
@@ -731,7 +731,7 @@ discard block |
||
731 | 731 | }); |
732 | 732 | |
733 | 733 | // Exception Event |
734 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::EXCEPTION, function (\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event) use ($app) { |
|
734 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::EXCEPTION, function(\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event) use ($app) { |
|
735 | 735 | |
736 | 736 | if (\Symfony\Component\HttpKernel\HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) { |
737 | 737 | return; |
@@ -761,7 +761,7 @@ discard block |
||
761 | 761 | }); |
762 | 762 | |
763 | 763 | // Terminate Event |
764 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::TERMINATE, function (\Symfony\Component\HttpKernel\Event\PostResponseEvent $event) use ($app) { |
|
764 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::TERMINATE, function(\Symfony\Component\HttpKernel\Event\PostResponseEvent $event) use ($app) { |
|
765 | 765 | |
766 | 766 | $route = $event->getRequest()->attributes->get('_route'); |
767 | 767 | |
@@ -840,7 +840,7 @@ discard block |
||
840 | 840 | |
841 | 841 | // const |
842 | 842 | if (isset($config['const'])) { |
843 | - $this['config'] = $this->share($this->extend('config', function ($eccubeConfig) use ($config) { |
|
843 | + $this['config'] = $this->share($this->extend('config', function($eccubeConfig) use ($config) { |
|
844 | 844 | $eccubeConfig[$config['code']] = array( |
845 | 845 | 'const' => $config['const'], |
846 | 846 | ); |
@@ -982,7 +982,7 @@ discard block |
||
982 | 982 | $app = $this; |
983 | 983 | |
984 | 984 | // Response Event(http cache対応、event実行は一番遅く設定) |
985 | - $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
985 | + $this->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
986 | 986 | |
987 | 987 | if ($app['config']['http_cache']['enabled']) { |
988 | 988 | // httpキャッシュが有効の場合 |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $config['template_realdir'] = $config['root_dir'].'/app/template/'.$templateCode; |
78 | 78 | $config['template_html_realdir'] = $config['public_path_realdir'].'/template/'.$templateCode; |
79 | 79 | $config['front_urlpath'] = $config['root_urlpath'].'/template/'.$templateCode; |
80 | - $config['block_realdir'] =$config['template_realdir'].'/Block'; |
|
80 | + $config['block_realdir'] = $config['template_realdir'].'/Block'; |
|
81 | 81 | |
82 | 82 | if (file_exists($file.'.php')) { |
83 | 83 | file_put_contents($file.'.php', sprintf('<?php return %s', var_export($config, true)).';'); |
@@ -117,19 +117,19 @@ discard block |
||
117 | 117 | // 該当テンプレートのディレクトリ |
118 | 118 | $config = $app['config']; |
119 | 119 | $templateCode = $Template->getCode(); |
120 | - $targetRealDir = $config['root_dir'] . '/app/template/' . $templateCode; |
|
121 | - $targetHtmlRealDir = $config['root_dir'] . '/html/template/' . $templateCode; |
|
120 | + $targetRealDir = $config['root_dir'].'/app/template/'.$templateCode; |
|
121 | + $targetHtmlRealDir = $config['root_dir'].'/html/template/'.$templateCode; |
|
122 | 122 | |
123 | 123 | // 一時ディレクトリ |
124 | 124 | $uniqId = sha1(Str::random(32)); |
125 | - $tmpDir = $config['template_temp_realdir'] . '/' . $uniqId; |
|
126 | - $appDir = $tmpDir . '/app'; |
|
127 | - $htmlDir = $tmpDir . '/html'; |
|
125 | + $tmpDir = $config['template_temp_realdir'].'/'.$uniqId; |
|
126 | + $appDir = $tmpDir.'/app'; |
|
127 | + $htmlDir = $tmpDir.'/html'; |
|
128 | 128 | |
129 | 129 | // ファイル名 |
130 | - $tarFile = $config['template_temp_realdir'] . '/' . $uniqId . '.tar'; |
|
131 | - $tarGzFile = $tarFile . '.gz'; |
|
132 | - $downloadFileName = $Template->getCode() . '.tar.gz'; |
|
130 | + $tarFile = $config['template_temp_realdir'].'/'.$uniqId.'.tar'; |
|
131 | + $tarGzFile = $tarFile.'.gz'; |
|
132 | + $downloadFileName = $Template->getCode().'.tar.gz'; |
|
133 | 133 | |
134 | 134 | // 該当テンプレートを一時ディレクトリへコピーする. |
135 | 135 | $fs = new Filesystem(); |
@@ -149,14 +149,14 @@ discard block |
||
149 | 149 | |
150 | 150 | // ダウンロード完了後にファイルを削除する. |
151 | 151 | // http://stackoverflow.com/questions/15238897/removing-file-after-delivering-response-with-silex-symfony |
152 | - $app->finish(function (Request $request, Response $response, \Silex\Application $app) use ( |
|
152 | + $app->finish(function(Request $request, Response $response, \Silex\Application $app) use ( |
|
153 | 153 | $tmpDir, |
154 | 154 | $tarFile, |
155 | 155 | $tarGzFile |
156 | 156 | ) { |
157 | - $app['monolog']->addDebug('remove temp file: ' . $tmpDir); |
|
158 | - $app['monolog']->addDebug('remove temp file: ' . $tarFile); |
|
159 | - $app['monolog']->addDebug('remove temp file: ' . $tarGzFile); |
|
157 | + $app['monolog']->addDebug('remove temp file: '.$tmpDir); |
|
158 | + $app['monolog']->addDebug('remove temp file: '.$tarFile); |
|
159 | + $app['monolog']->addDebug('remove temp file: '.$tarGzFile); |
|
160 | 160 | $fs = new Filesystem(); |
161 | 161 | $fs->remove($tmpDir); |
162 | 162 | $fs->remove($tarFile); |
@@ -197,8 +197,8 @@ discard block |
||
197 | 197 | // テンプレートディレクトリの削除 |
198 | 198 | $config = $app['config']; |
199 | 199 | $templateCode = $Template->getCode(); |
200 | - $targetRealDir = $config['root_dir'] . '/app/template/' . $templateCode; |
|
201 | - $targetHtmlRealDir = $config['root_dir'] . '/html/template/' . $templateCode; |
|
200 | + $targetRealDir = $config['root_dir'].'/app/template/'.$templateCode; |
|
201 | + $targetHtmlRealDir = $config['root_dir'].'/html/template/'.$templateCode; |
|
202 | 202 | |
203 | 203 | $fs = new Filesystem(); |
204 | 204 | $fs->remove($targetRealDir); |
@@ -241,18 +241,18 @@ discard block |
||
241 | 241 | // 該当テンプレートのディレクトリ |
242 | 242 | $config = $app['config']; |
243 | 243 | $templateCode = $Template->getCode(); |
244 | - $targetRealDir = $config['root_dir'] . '/app/template/' . $templateCode; |
|
245 | - $targetHtmlRealDir = $config['root_dir'] . '/html/template/' . $templateCode; |
|
244 | + $targetRealDir = $config['root_dir'].'/app/template/'.$templateCode; |
|
245 | + $targetHtmlRealDir = $config['root_dir'].'/html/template/'.$templateCode; |
|
246 | 246 | |
247 | 247 | // 一時ディレクトリ |
248 | 248 | $uniqId = sha1(Str::random(32)); |
249 | - $tmpDir = $config['template_temp_realdir'] . '/' . $uniqId; |
|
250 | - $appDir = $tmpDir . '/app'; |
|
251 | - $htmlDir = $tmpDir . '/html'; |
|
249 | + $tmpDir = $config['template_temp_realdir'].'/'.$uniqId; |
|
250 | + $appDir = $tmpDir.'/app'; |
|
251 | + $htmlDir = $tmpDir.'/html'; |
|
252 | 252 | |
253 | 253 | $formFile = $form['file']->getData(); |
254 | 254 | // ファイル名 |
255 | - $archive = $templateCode . '.' . $formFile->getClientOriginalExtension(); |
|
255 | + $archive = $templateCode.'.'.$formFile->getClientOriginalExtension(); |
|
256 | 256 | |
257 | 257 | // ファイルを一時ディレクトリへ移動. |
258 | 258 | $formFile->move($tmpDir, $archive); |
@@ -261,11 +261,11 @@ discard block |
||
261 | 261 | try { |
262 | 262 | if ($formFile->getClientOriginalExtension() == 'zip') { |
263 | 263 | $zip = new \ZipArchive(); |
264 | - $zip->open($tmpDir . '/' . $archive); |
|
264 | + $zip->open($tmpDir.'/'.$archive); |
|
265 | 265 | $zip->extractTo($tmpDir); |
266 | 266 | $zip->close(); |
267 | 267 | } else { |
268 | - $phar = new \PharData($tmpDir . '/' . $archive); |
|
268 | + $phar = new \PharData($tmpDir.'/'.$archive); |
|
269 | 269 | $phar->extractTo($tmpDir, null, true); |
270 | 270 | } |
271 | 271 | } catch (\Exception $e) { |
@@ -58,7 +58,7 @@ |
||
58 | 58 | } |
59 | 59 | if ($dir == 'doctrine') { |
60 | 60 | // doctrineが指定された場合は, cache driver経由で削除. |
61 | - $config = $app['orm.em']->getConfiguration(); |
|
61 | + $config = $app['orm.em']->getConfiguration(); |
|
62 | 62 | $this->deleteDoctrineCache($config->getMetadataCacheImpl()); |
63 | 63 | $this->deleteDoctrineCache($config->getQueryCacheImpl()); |
64 | 64 | $this->deleteDoctrineCache($config->getResultCacheImpl()); |
@@ -234,13 +234,13 @@ discard block |
||
234 | 234 | '\Eccube\Entity\Customer' |
235 | 235 | ))); |
236 | 236 | |
237 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($BaseInfo) { |
|
237 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($BaseInfo) { |
|
238 | 238 | |
239 | 239 | $data = $event->getData(); |
240 | 240 | $orderDetails = &$data['OrderDetails']; |
241 | 241 | |
242 | 242 | // 数量0フィルター |
243 | - $quantityFilter = function ($v) { |
|
243 | + $quantityFilter = function($v) { |
|
244 | 244 | return !(isset($v['quantity']) && preg_match('/^0+$/', trim($v['quantity']))); |
245 | 245 | }; |
246 | 246 | |
@@ -249,10 +249,9 @@ discard block |
||
249 | 249 | $shippings = &$data['Shippings']; |
250 | 250 | |
251 | 251 | // 数量を抽出 |
252 | - $getQuantity = function ($v) { |
|
252 | + $getQuantity = function($v) { |
|
253 | 253 | return (isset($v['quantity']) && preg_match('/^\d+$/', trim($v['quantity']))) ? |
254 | - trim($v['quantity']) : |
|
255 | - 0; |
|
254 | + trim($v['quantity']) : 0; |
|
256 | 255 | }; |
257 | 256 | |
258 | 257 | foreach ($shippings as &$shipping) { |
@@ -268,7 +267,7 @@ discard block |
||
268 | 267 | $orderDetail['quantity'] = 0; |
269 | 268 | |
270 | 269 | // 受注詳細と同じ商品規格のみ抽出 |
271 | - $productClassFilter = function ($v) use ($orderDetail) { |
|
270 | + $productClassFilter = function($v) use ($orderDetail) { |
|
272 | 271 | return $orderDetail['ProductClass'] === $v['ProductClass']; |
273 | 272 | }; |
274 | 273 | |
@@ -277,10 +276,9 @@ discard block |
||
277 | 276 | if (!empty($shipping['ShipmentItems'])) { |
278 | 277 | |
279 | 278 | // 同じ商品規格の受注詳細の価格を適用 |
280 | - $applyPrice = function (&$v) use ($orderDetail) { |
|
279 | + $applyPrice = function(&$v) use ($orderDetail) { |
|
281 | 280 | $v['price'] = ($v['ProductClass'] === $orderDetail['ProductClass']) ? |
282 | - $orderDetail['price'] : |
|
283 | - $v['price']; |
|
281 | + $orderDetail['price'] : $v['price']; |
|
284 | 282 | }; |
285 | 283 | array_walk($shipping['ShipmentItems'], $applyPrice); |
286 | 284 | |
@@ -300,7 +298,7 @@ discard block |
||
300 | 298 | |
301 | 299 | $event->setData($data); |
302 | 300 | }); |
303 | - $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { |
|
301 | + $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) { |
|
304 | 302 | $form = $event->getForm(); |
305 | 303 | $orderDetails = $form['OrderDetails']->getData(); |
306 | 304 | if (empty($orderDetails) || count($orderDetails) < 1) { |
@@ -106,7 +106,7 @@ |
||
106 | 106 | $class2Valied = $this->isValiedCategory($ClassName2); |
107 | 107 | |
108 | 108 | // 規格が選択されていないか、選択された状態で分類が保有されていれば、画面表示 |
109 | - if($class1Valied && $class2Valied){ |
|
109 | + if ($class1Valied && $class2Valied) { |
|
110 | 110 | $hasClassCategoryFlg = true; |
111 | 111 | } |
112 | 112 |
@@ -65,12 +65,12 @@ discard block |
||
65 | 65 | { |
66 | 66 | // install.phpのチェック. |
67 | 67 | if (isset($app['config']['eccube_install']) && $app['config']['eccube_install'] == 1) { |
68 | - $file = $app['config']['root_dir'] . '/html/install.php'; |
|
68 | + $file = $app['config']['root_dir'].'/html/install.php'; |
|
69 | 69 | if (file_exists($file)) { |
70 | 70 | $message = $app->trans('admin.install.warning', array('installphpPath' => 'html/install.php')); |
71 | 71 | $app->addWarning($message, 'admin'); |
72 | 72 | } |
73 | - $fileOnRoot = $app['config']['root_dir'] . '/install.php'; |
|
73 | + $fileOnRoot = $app['config']['root_dir'].'/install.php'; |
|
74 | 74 | if (file_exists($fileOnRoot)) { |
75 | 75 | $message = $app->trans('admin.install.warning', array('installphpPath' => 'install.php')); |
76 | 76 | $app->addWarning($message, 'admin'); |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | t1.status |
312 | 312 | ORDER BY |
313 | 313 | t1.status'; |
314 | - $rsm = new ResultSetMapping();; |
|
314 | + $rsm = new ResultSetMapping(); ; |
|
315 | 315 | $rsm->addScalarResult('status', 'status'); |
316 | 316 | $rsm->addScalarResult('count', 'count'); |
317 | 317 | $query = $em->createNativeQuery($sql, $rsm); |