@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | { |
| 33 | 33 | public function register(Container $app) |
| 34 | 34 | { |
| 35 | - $app['validator'] = function ($app) { |
|
| 35 | + $app['validator'] = function($app) { |
|
| 36 | 36 | |
| 37 | 37 | return new Validator( |
| 38 | 38 | $app['validator.mapping.class_metadata_factory'], |
@@ -43,17 +43,17 @@ discard block |
||
| 43 | 43 | ); |
| 44 | 44 | }; |
| 45 | 45 | |
| 46 | - $app['validator.mapping.class_metadata_factory'] = function ($app) { |
|
| 46 | + $app['validator.mapping.class_metadata_factory'] = function($app) { |
|
| 47 | 47 | return new ClassMetadataFactory(new StaticMethodLoader()); |
| 48 | 48 | }; |
| 49 | 49 | |
| 50 | - $app['validator.validator_factory'] = function () use ($app) { |
|
| 50 | + $app['validator.validator_factory'] = function() use ($app) { |
|
| 51 | 51 | $validators = isset($app['validator.validator_service_ids']) ? $app['validator.validator_service_ids'] : array(); |
| 52 | 52 | |
| 53 | 53 | return new ConstraintValidatorFactory($app, $validators); |
| 54 | 54 | }; |
| 55 | 55 | |
| 56 | - $app['validator.object_initializers'] = function ($app) { |
|
| 56 | + $app['validator.object_initializers'] = function($app) { |
|
| 57 | 57 | return array(); |
| 58 | 58 | }; |
| 59 | 59 | } |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | public function register(Container $app) |
| 26 | 26 | { |
| 27 | 27 | // EventDispatcher |
| 28 | - $app['eccube.event.dispatcher'] = function () { |
|
| 28 | + $app['eccube.event.dispatcher'] = function() { |
|
| 29 | 29 | return new EventDispatcher(); |
| 30 | 30 | }; |
| 31 | 31 | |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $config = $pluginConfig['config']; |
| 37 | 37 | |
| 38 | 38 | if (isset($config['const'])) { |
| 39 | - $app->extend('config', function ($eccubeConfig) use ($config) { |
|
| 39 | + $app->extend('config', function($eccubeConfig) use ($config) { |
|
| 40 | 40 | $eccubeConfig[$config['code']] = array( |
| 41 | 41 | 'const' => $config['const'], |
| 42 | 42 | ); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | public function initPluginEventDispatcher(Application $app) |
| 73 | 73 | { |
| 74 | 74 | // hook point |
| 75 | - $app->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($app) { |
|
| 75 | + $app->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($app) { |
|
| 76 | 76 | if (!$event->isMasterRequest()) { |
| 77 | 77 | return; |
| 78 | 78 | } |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 81 | 81 | }, Application::EARLY_EVENT); |
| 82 | 82 | |
| 83 | - $app->on(KernelEvents::REQUEST, function (GetResponseEvent $event) use ($app) { |
|
| 83 | + $app->on(KernelEvents::REQUEST, function(GetResponseEvent $event) use ($app) { |
|
| 84 | 84 | if (!$event->isMasterRequest()) { |
| 85 | 85 | return; |
| 86 | 86 | } |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 90 | 90 | }); |
| 91 | 91 | |
| 92 | - $app->on(KernelEvents::RESPONSE, function (FilterResponseEvent $event) use ($app) { |
|
| 92 | + $app->on(KernelEvents::RESPONSE, function(FilterResponseEvent $event) use ($app) { |
|
| 93 | 93 | if (!$event->isMasterRequest()) { |
| 94 | 94 | return; |
| 95 | 95 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 99 | 99 | }); |
| 100 | 100 | |
| 101 | - $app->on(KernelEvents::RESPONSE, function (FilterResponseEvent $event) use ($app) { |
|
| 101 | + $app->on(KernelEvents::RESPONSE, function(FilterResponseEvent $event) use ($app) { |
|
| 102 | 102 | if (!$event->isMasterRequest()) { |
| 103 | 103 | return; |
| 104 | 104 | } |
@@ -106,13 +106,13 @@ discard block |
||
| 106 | 106 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 107 | 107 | }, Application::LATE_EVENT); |
| 108 | 108 | |
| 109 | - $app->on(KernelEvents::TERMINATE, function (PostResponseEvent $event) use ($app) { |
|
| 109 | + $app->on(KernelEvents::TERMINATE, function(PostResponseEvent $event) use ($app) { |
|
| 110 | 110 | $route = $event->getRequest()->attributes->get('_route'); |
| 111 | 111 | $hookpoint = "eccube.event.controller.$route.finish"; |
| 112 | 112 | $app['eccube.event.dispatcher']->dispatch($hookpoint, $event); |
| 113 | 113 | }); |
| 114 | 114 | |
| 115 | - $app->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 115 | + $app->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 116 | 116 | if (!$event->isMasterRequest()) { |
| 117 | 117 | return; |
| 118 | 118 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | }); |
| 122 | 122 | |
| 123 | 123 | // Request Event |
| 124 | - $app->on(\Symfony\Component\HttpKernel\KernelEvents::REQUEST, function (\Symfony\Component\HttpKernel\Event\GetResponseEvent $event) use ($app) { |
|
| 124 | + $app->on(\Symfony\Component\HttpKernel\KernelEvents::REQUEST, function(\Symfony\Component\HttpKernel\Event\GetResponseEvent $event) use ($app) { |
|
| 125 | 125 | |
| 126 | 126 | if (!$event->isMasterRequest()) { |
| 127 | 127 | return; |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | }, 30); // Routing(32)が解決し, 認証判定(8)が実行される前のタイミング. |
| 153 | 153 | |
| 154 | 154 | // Controller Event |
| 155 | - $app->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function (\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) { |
|
| 155 | + $app->on(\Symfony\Component\HttpKernel\KernelEvents::CONTROLLER, function(\Symfony\Component\HttpKernel\Event\FilterControllerEvent $event) use ($app) { |
|
| 156 | 156 | |
| 157 | 157 | if (!$event->isMasterRequest()) { |
| 158 | 158 | return; |
@@ -181,7 +181,7 @@ discard block |
||
| 181 | 181 | }); |
| 182 | 182 | |
| 183 | 183 | // Response Event |
| 184 | - $app->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function (\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 184 | + $app->on(\Symfony\Component\HttpKernel\KernelEvents::RESPONSE, function(\Symfony\Component\HttpKernel\Event\FilterResponseEvent $event) use ($app) { |
|
| 185 | 185 | if (!$event->isMasterRequest()) { |
| 186 | 186 | return; |
| 187 | 187 | } |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | }); |
| 211 | 211 | |
| 212 | 212 | // Exception Event |
| 213 | - $app->on(\Symfony\Component\HttpKernel\KernelEvents::EXCEPTION, function (\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event) use ($app) { |
|
| 213 | + $app->on(\Symfony\Component\HttpKernel\KernelEvents::EXCEPTION, function(\Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event) use ($app) { |
|
| 214 | 214 | |
| 215 | 215 | if (!$event->isMasterRequest()) { |
| 216 | 216 | return; |
@@ -240,7 +240,7 @@ discard block |
||
| 240 | 240 | }); |
| 241 | 241 | |
| 242 | 242 | // Terminate Event |
| 243 | - $app->on(\Symfony\Component\HttpKernel\KernelEvents::TERMINATE, function (\Symfony\Component\HttpKernel\Event\PostResponseEvent $event) use ($app) { |
|
| 243 | + $app->on(\Symfony\Component\HttpKernel\KernelEvents::TERMINATE, function(\Symfony\Component\HttpKernel\Event\PostResponseEvent $event) use ($app) { |
|
| 244 | 244 | |
| 245 | 245 | $route = $event->getRequest()->attributes->get('_route'); |
| 246 | 246 | |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | 'label' => false, |
| 42 | 42 | 'class' => 'Eccube\Entity\PageLayout', |
| 43 | 43 | 'choice_label' => 'name', |
| 44 | - 'query_builder' => function (EntityRepository $er) { |
|
| 44 | + 'query_builder' => function(EntityRepository $er) { |
|
| 45 | 45 | return $er |
| 46 | 46 | ->createQueryBuilder('l') |
| 47 | 47 | ->where('l.id <> 0') |
@@ -57,8 +57,8 @@ |
||
| 57 | 57 | new Assert\NotBlank(), |
| 58 | 58 | new Assert\Length(array('max' => $this->config['stext_len'])), |
| 59 | 59 | new Assert\Regex(array( |
| 60 | - 'pattern' => "/^[0-9a-zA-Z]+$/", |
|
| 61 | - )), |
|
| 60 | + 'pattern' => "/^[0-9a-zA-Z]+$/", |
|
| 61 | + )), |
|
| 62 | 62 | ), |
| 63 | 63 | )) |
| 64 | 64 | ->add('admin_allow_host', TextareaType::class, array( |
@@ -72,19 +72,19 @@ |
||
| 72 | 72 | 'label' => 'SSLを強制', |
| 73 | 73 | 'required' => false, |
| 74 | 74 | )) |
| 75 | - ->addEventListener(FormEvents::POST_SUBMIT, function ($event) use($app) { |
|
| 75 | + ->addEventListener(FormEvents::POST_SUBMIT, function($event) use($app) { |
|
| 76 | 76 | $form = $event->getForm(); |
| 77 | 77 | $data = $form->getData(); |
| 78 | 78 | |
| 79 | 79 | $ips = preg_split("/\R/", $data['admin_allow_host'], null, PREG_SPLIT_NO_EMPTY); |
| 80 | 80 | |
| 81 | - foreach($ips as $ip) { |
|
| 81 | + foreach ($ips as $ip) { |
|
| 82 | 82 | $errors = $app['validator']->validate($ip, array( |
| 83 | 83 | new Assert\Ip(), |
| 84 | 84 | ) |
| 85 | 85 | ); |
| 86 | 86 | if ($errors->count() != 0) { |
| 87 | - $form['admin_allow_host']->addError(new FormError($ip . 'はIPv4アドレスではありません。')); |
|
| 87 | + $form['admin_allow_host']->addError(new FormError($ip.'はIPv4アドレスではありません。')); |
|
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | }) |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | ))); |
| 115 | 115 | |
| 116 | 116 | $app = $this->app; |
| 117 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($app) { |
|
| 117 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($app) { |
|
| 118 | 118 | // モーダルからのPOST時に、金額等をセットする. |
| 119 | 119 | if ('modal' === $app['request_stack']->getCurrentRequest()->get('modal')) { |
| 120 | 120 | $data = $event->getData(); |
@@ -131,17 +131,13 @@ discard block |
||
| 131 | 131 | $data['product_name'] = $Product->getName(); |
| 132 | 132 | $data['product_code'] = $ProductClass->getCode(); |
| 133 | 133 | $data['class_name1'] = $ProductClass->hasClassCategory1() ? |
| 134 | - $ProductClass->getClassCategory1()->getClassName() : |
|
| 135 | - null; |
|
| 134 | + $ProductClass->getClassCategory1()->getClassName() : null; |
|
| 136 | 135 | $data['class_name2'] = $ProductClass->hasClassCategory2() ? |
| 137 | - $ProductClass->getClassCategory2()->getClassName() : |
|
| 138 | - null; |
|
| 136 | + $ProductClass->getClassCategory2()->getClassName() : null; |
|
| 139 | 137 | $data['class_category_name1'] = $ProductClass->hasClassCategory1() ? |
| 140 | - $ProductClass->getClassCategory1()->getName() : |
|
| 141 | - null; |
|
| 138 | + $ProductClass->getClassCategory1()->getName() : null; |
|
| 142 | 139 | $data['class_category_name2'] = $ProductClass->hasClassCategory2() ? |
| 143 | - $ProductClass->getClassCategory2()->getName() : |
|
| 144 | - null; |
|
| 140 | + $ProductClass->getClassCategory2()->getName() : null; |
|
| 145 | 141 | $data['tax_rule'] = $TaxRule->getCalcRule()->getId(); |
| 146 | 142 | $data['price'] = $ProductClass->getPrice02(); |
| 147 | 143 | $data['quantity'] = empty($data['quantity']) ? 1 : $data['quantity']; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | $app = $this->app; |
| 50 | 50 | |
| 51 | 51 | $builder |
| 52 | - ->addEventListener(FormEvents::PRE_SET_DATA, function ($event) use ($app) { |
|
| 52 | + ->addEventListener(FormEvents::PRE_SET_DATA, function($event) use ($app) { |
|
| 53 | 53 | /** @var \Eccube\Entity\Shipping $data */ |
| 54 | 54 | $data = $event->getData(); |
| 55 | 55 | /** @var \Symfony\Component\Form\Form $form */ |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | 'placeholder' => '指定なし', |
| 103 | 103 | )); |
| 104 | 104 | }) |
| 105 | - ->addEventListener(FormEvents::POST_SET_DATA, function (FormEvent $event) { |
|
| 105 | + ->addEventListener(FormEvents::POST_SET_DATA, function(FormEvent $event) { |
|
| 106 | 106 | /** @var \Eccube\Entity\Shipping $data */ |
| 107 | 107 | $data = $event->getData(); |
| 108 | 108 | /** @var \Symfony\Component\Form\Form $form */ |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | }) |
| 121 | - ->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { |
|
| 121 | + ->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) { |
|
| 122 | 122 | /** @var \Eccube\Entity\Shipping $data */ |
| 123 | 123 | $data = $event->getData(); |
| 124 | 124 | /** @var \Symfony\Component\Form\Form $form */ |
@@ -79,7 +79,7 @@ |
||
| 79 | 79 | $builder->setAttribute('tel02_name', $options['tel02_name']); |
| 80 | 80 | $builder->setAttribute('tel03_name', $options['tel03_name']); |
| 81 | 81 | // todo 変 |
| 82 | - $builder->addEventListener(FormEvents::POST_SUBMIT, function ($event) use ($builder) { |
|
| 82 | + $builder->addEventListener(FormEvents::POST_SUBMIT, function($event) use ($builder) { |
|
| 83 | 83 | $form = $event->getForm(); |
| 84 | 84 | $count = 0; |
| 85 | 85 | if ($form[$builder->getName().'01']->getData() != '') { |
@@ -147,19 +147,19 @@ |
||
| 147 | 147 | 'help' => 'メーラーバックエンドがSMTPかつSMTP-AUTH使用時のみ指定', |
| 148 | 148 | 'required' => false, |
| 149 | 149 | )) |
| 150 | - ->addEventListener(FormEvents::POST_SUBMIT, function ($event) use($app) { |
|
| 150 | + ->addEventListener(FormEvents::POST_SUBMIT, function($event) use($app) { |
|
| 151 | 151 | $form = $event->getForm(); |
| 152 | 152 | $data = $form->getData(); |
| 153 | 153 | |
| 154 | 154 | $ips = preg_split("/\R/", $data['admin_allow_hosts'], null, PREG_SPLIT_NO_EMPTY); |
| 155 | 155 | |
| 156 | - foreach($ips as $ip) { |
|
| 156 | + foreach ($ips as $ip) { |
|
| 157 | 157 | $errors = $app['validator']->validate($ip, array( |
| 158 | 158 | new Assert\Ip(), |
| 159 | 159 | ) |
| 160 | 160 | ); |
| 161 | 161 | if ($errors->count() != 0) { |
| 162 | - $form['admin_allow_hosts']->addError(new FormError($ip . 'はIPv4アドレスではありません。')); |
|
| 162 | + $form['admin_allow_hosts']->addError(new FormError($ip.'はIPv4アドレスではありません。')); |
|
| 163 | 163 | } |
| 164 | 164 | } |
| 165 | 165 | }) |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | 'label' => 'パスワード', |
| 95 | 95 | 'required' => false, |
| 96 | 96 | )) |
| 97 | - ->addEventListener(FormEvents::POST_SUBMIT, function ($event) { |
|
| 97 | + ->addEventListener(FormEvents::POST_SUBMIT, function($event) { |
|
| 98 | 98 | $form = $event->getForm(); |
| 99 | 99 | $data = $form->getData(); |
| 100 | 100 | try { |
@@ -119,7 +119,7 @@ discard block |
||
| 119 | 119 | $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); |
| 120 | 120 | $conn->connect(); |
| 121 | 121 | } catch (\Exception $e) { |
| 122 | - $form['database']->addError(new FormError('データベースに接続できませんでした。' . $e->getMessage())); |
|
| 122 | + $form['database']->addError(new FormError('データベースに接続できませんでした。'.$e->getMessage())); |
|
| 123 | 123 | } |
| 124 | 124 | }); |
| 125 | 125 | } |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | public function validate($data, ExecutionContext $context, $param = null) |
| 136 | 136 | { |
| 137 | 137 | $parameters = $this->app['request_stack']->getCurrentRequest()->get('install_step4'); |
| 138 | - if ($parameters['database'] != 'pdo_sqlite'){ |
|
| 138 | + if ($parameters['database'] != 'pdo_sqlite') { |
|
| 139 | 139 | $context->getValidator()->validate($data, array( |
| 140 | 140 | new Assert\NotBlank() |
| 141 | 141 | )); |