@@ -33,7 +33,6 @@ |
||
| 33 | 33 | use Symfony\Component\Console\Input\InputOption; |
| 34 | 34 | use Symfony\Component\Console\Output\OutputInterface; |
| 35 | 35 | use Symfony\Component\Console\Question\Question; |
| 36 | -use Symfony\Component\Validator\Constraints as Assert; |
|
| 37 | 36 | |
| 38 | 37 | class PluginCommand extends \Knp\Command\Command |
| 39 | 38 | { |
@@ -2,15 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Eccube\Application; |
| 4 | 4 | |
| 5 | -use Eccube\Event\TemplateEvent; |
|
| 6 | -use Monolog\Logger; |
|
| 7 | -use Symfony\Component\Form\FormBuilder; |
|
| 8 | 5 | use Symfony\Component\HttpFoundation\Request; |
| 9 | 6 | use Symfony\Component\HttpFoundation\Response; |
| 10 | -use Symfony\Component\HttpFoundation\StreamedResponse; |
|
| 11 | 7 | use Symfony\Component\HttpKernel\HttpKernelInterface; |
| 12 | -use Symfony\Component\Routing\Generator\UrlGeneratorInterface; |
|
| 13 | -use Symfony\Component\Security\Core\User\UserInterface; |
|
| 14 | 8 | |
| 15 | 9 | trait ApplicationTrait |
| 16 | 10 | { |
@@ -19,32 +19,32 @@ discard block |
||
| 19 | 19 | */ |
| 20 | 20 | public function addSuccess($message, $namespace = 'front') |
| 21 | 21 | { |
| 22 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.success', $message); |
|
| 22 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.success', $message); |
|
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | public function addError($message, $namespace = 'front') |
| 26 | 26 | { |
| 27 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.error', $message); |
|
| 27 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.error', $message); |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | public function addDanger($message, $namespace = 'front') |
| 31 | 31 | { |
| 32 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.danger', $message); |
|
| 32 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.danger', $message); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | public function addWarning($message, $namespace = 'front') |
| 36 | 36 | { |
| 37 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.warning', $message); |
|
| 37 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.warning', $message); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public function addInfo($message, $namespace = 'front') |
| 41 | 41 | { |
| 42 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.info', $message); |
|
| 42 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.info', $message); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | public function addRequestError($message, $namespace = 'front') |
| 46 | 46 | { |
| 47 | - $this['session']->getFlashBag()->set('eccube.' . $namespace . '.request.error', $message); |
|
| 47 | + $this['session']->getFlashBag()->set('eccube.'.$namespace.'.request.error', $message); |
|
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | public function clearMessage() |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | if (is_null($namespace)) { |
| 64 | 64 | $this['session']->getFlashBag()->set('eccube.login.target.path', $targetPath); |
| 65 | 65 | } else { |
| 66 | - $this['session']->getFlashBag()->set('eccube.' . $namespace . '.login.target.path', $targetPath); |
|
| 66 | + $this['session']->getFlashBag()->set('eccube.'.$namespace.'.login.target.path', $targetPath); |
|
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * @param Response $response |
| 112 | 112 | * @return Application |
| 113 | 113 | */ |
| 114 | - public function forwardChain($path, array $requestParameters = [], Response &$response = null) |
|
| 114 | + public function forwardChain($path, array $requestParameters = [], Response&$response = null) |
|
| 115 | 115 | { |
| 116 | 116 | $response = $this->forward($path, $requestParameters); |
| 117 | 117 | return $this; |
@@ -16,6 +16,7 @@ discard block |
||
| 16 | 16 | { |
| 17 | 17 | /** |
| 18 | 18 | * Application Shortcut Methods |
| 19 | + * @param string $message |
|
| 19 | 20 | */ |
| 20 | 21 | public function addSuccess($message, $namespace = 'front') |
| 21 | 22 | { |
@@ -58,6 +59,9 @@ discard block |
||
| 58 | 59 | $this->addWarning('admin.delete.warning', 'admin'); |
| 59 | 60 | } |
| 60 | 61 | |
| 62 | + /** |
|
| 63 | + * @param string $targetPath |
|
| 64 | + */ |
|
| 61 | 65 | public function setLoginTargetPath($targetPath, $namespace = null) |
| 62 | 66 | { |
| 63 | 67 | if (is_null($namespace)) { |
@@ -109,7 +113,7 @@ discard block |
||
| 109 | 113 | * @param string $path フォワード先のパス |
| 110 | 114 | * @param array $requestParameters |
| 111 | 115 | * @param Response $response |
| 112 | - * @return Application |
|
| 116 | + * @return ApplicationTrait |
|
| 113 | 117 | */ |
| 114 | 118 | public function forwardChain($path, array $requestParameters = [], Response &$response = null) |
| 115 | 119 | { |
@@ -52,11 +52,17 @@ |
||
| 52 | 52 | return $form; |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | + /** |
|
| 56 | + * @param Application $app |
|
| 57 | + */ |
|
| 55 | 58 | protected function getSecurity($app) |
| 56 | 59 | { |
| 57 | 60 | return $app['security.token_storage']; |
| 58 | 61 | } |
| 59 | 62 | |
| 63 | + /** |
|
| 64 | + * @param Application $app |
|
| 65 | + */ |
|
| 60 | 66 | protected function isTokenValid($app) |
| 61 | 67 | { |
| 62 | 68 | $csrf = $app['csrf.token_manager']; |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | @trigger_error('The '.__METHOD__.' method is deprecated.', E_USER_DEPRECATED); |
| 46 | 46 | |
| 47 | 47 | $form = $app['form.factory'] |
| 48 | - ->createBuilder($app['eccube.form.type.' . $type], $app['eccube.entity.' . $type]) |
|
| 48 | + ->createBuilder($app['eccube.form.type.'.$type], $app['eccube.entity.'.$type]) |
|
| 49 | 49 | ->getForm(); |
| 50 | 50 | $form->handleRequest($app['request_stack']->getCurrentRequest()); |
| 51 | 51 | |
@@ -37,6 +37,9 @@ |
||
| 37 | 37 | { |
| 38 | 38 | private $app; |
| 39 | 39 | |
| 40 | + /** |
|
| 41 | + * @param \Pimple\Container $app |
|
| 42 | + */ |
|
| 40 | 43 | public function __construct($app) |
| 41 | 44 | { |
| 42 | 45 | $this->app = $app; |
@@ -27,8 +27,6 @@ |
||
| 27 | 27 | use Symfony\Component\Form\Extension\Core\Type\PasswordType; |
| 28 | 28 | use Symfony\Component\Form\Extension\Core\Type\RepeatedType; |
| 29 | 29 | use Symfony\Component\Form\FormBuilderInterface; |
| 30 | -use Symfony\Component\Form\FormError; |
|
| 31 | -use Symfony\Component\Form\FormEvents; |
|
| 32 | 30 | use Symfony\Component\OptionsResolver\OptionsResolver; |
| 33 | 31 | use Symfony\Component\Security\Core\Validator\Constraints\UserPassword; |
| 34 | 32 | use Symfony\Component\Validator\Constraints as Assert; |
@@ -32,7 +32,6 @@ |
||
| 32 | 32 | use Symfony\Component\Form\Extension\Core\Type\HiddenType; |
| 33 | 33 | use Symfony\Component\Form\Extension\Core\Type\TextType; |
| 34 | 34 | use Symfony\Component\Form\FormBuilderInterface; |
| 35 | -use Symfony\Component\Validator\Constraints as Assert; |
|
| 36 | 35 | |
| 37 | 36 | class SearchProductType extends AbstractType |
| 38 | 37 | { |
@@ -39,7 +39,7 @@ |
||
| 39 | 39 | * This method should only be used to configure services and parameters. |
| 40 | 40 | * It should not get services. |
| 41 | 41 | * |
| 42 | - * @param BaseApplication $app An Application instance |
|
| 42 | + * @param Container $app An Application instance |
|
| 43 | 43 | */ |
| 44 | 44 | public function register(Container $app) |
| 45 | 45 | { |
@@ -59,31 +59,31 @@ discard block |
||
| 59 | 59 | public function register(Container $app) |
| 60 | 60 | { |
| 61 | 61 | // Service |
| 62 | - $app['eccube.service.system'] = function () use ($app) { |
|
| 62 | + $app['eccube.service.system'] = function() use ($app) { |
|
| 63 | 63 | return new \Eccube\Service\SystemService($app); |
| 64 | 64 | }; |
| 65 | - $app['view'] = function () use ($app) { |
|
| 65 | + $app['view'] = function() use ($app) { |
|
| 66 | 66 | return $app['twig']; |
| 67 | 67 | }; |
| 68 | - $app['eccube.service.cart'] = function () use ($app) { |
|
| 68 | + $app['eccube.service.cart'] = function() use ($app) { |
|
| 69 | 69 | return new \Eccube\Service\CartService($app['session'], $app['orm.em']); |
| 70 | 70 | }; |
| 71 | - $app['eccube.service.order'] = function () use ($app) { |
|
| 71 | + $app['eccube.service.order'] = function() use ($app) { |
|
| 72 | 72 | return new \Eccube\Service\OrderService($app); |
| 73 | 73 | }; |
| 74 | - $app['eccube.service.tax_rule'] = function () use ($app) { |
|
| 74 | + $app['eccube.service.tax_rule'] = function() use ($app) { |
|
| 75 | 75 | return new \Eccube\Service\TaxRuleService($app['eccube.repository.tax_rule']); |
| 76 | 76 | }; |
| 77 | - $app['eccube.service.plugin'] = function () use ($app) { |
|
| 77 | + $app['eccube.service.plugin'] = function() use ($app) { |
|
| 78 | 78 | return new \Eccube\Service\PluginService($app); |
| 79 | 79 | }; |
| 80 | - $app['eccube.service.mail'] = function () use ($app) { |
|
| 80 | + $app['eccube.service.mail'] = function() use ($app) { |
|
| 81 | 81 | return new \Eccube\Service\MailService($app); |
| 82 | 82 | }; |
| 83 | - $app['eccube.calculate.context'] = function () use ($app) { |
|
| 83 | + $app['eccube.calculate.context'] = function() use ($app) { |
|
| 84 | 84 | return new \Eccube\Service\Calculator\CalculateContext(); |
| 85 | 85 | }; |
| 86 | - $app['eccube.service.calculate'] = $app->protect(function ($Order, $Customer) use ($app) { |
|
| 86 | + $app['eccube.service.calculate'] = $app->protect(function($Order, $Customer) use ($app) { |
|
| 87 | 87 | $Service = new \Eccube\Service\CalculateService($Order, $Customer); |
| 88 | 88 | $Context = $app['eccube.calculate.context']; |
| 89 | 89 | $app['eccube.calculate.strategies']->setOrder($Order); |
@@ -93,13 +93,13 @@ discard block |
||
| 93 | 93 | return $Service; |
| 94 | 94 | }); |
| 95 | 95 | |
| 96 | - $app['eccube.service.payment'] = $app->protect(function ($clazz) use ($app) { |
|
| 96 | + $app['eccube.service.payment'] = $app->protect(function($clazz) use ($app) { |
|
| 97 | 97 | $Service = new $clazz; |
| 98 | 98 | $Service->setApplication($app); |
| 99 | 99 | return $Service; |
| 100 | 100 | }); |
| 101 | 101 | |
| 102 | - $app['eccube.calculate.strategies'] = function () use ($app) { |
|
| 102 | + $app['eccube.calculate.strategies'] = function() use ($app) { |
|
| 103 | 103 | $Collection = new \Eccube\Service\Calculator\CalculateStrategyCollection(); |
| 104 | 104 | $Collection->setApplication($app); |
| 105 | 105 | //$Collection->setOrder($Order); |
@@ -112,47 +112,47 @@ discard block |
||
| 112 | 112 | $Collection->add($app['eccube.calculate.strategy.calculate_total']); |
| 113 | 113 | return $Collection; |
| 114 | 114 | }; |
| 115 | - $app['eccube.calculate.strategy.shipping'] = function () use ($app) { |
|
| 115 | + $app['eccube.calculate.strategy.shipping'] = function() use ($app) { |
|
| 116 | 116 | $Strategy = new \Eccube\Service\Calculator\Strategy\ShippingStrategy(); |
| 117 | 117 | $Strategy->setApplication($app); |
| 118 | 118 | return $Strategy; |
| 119 | 119 | }; |
| 120 | - $app['eccube.calculate.strategy.charge'] = function () use ($app) { |
|
| 120 | + $app['eccube.calculate.strategy.charge'] = function() use ($app) { |
|
| 121 | 121 | $Strategy = new \Eccube\Service\Calculator\Strategy\ChargeStrategy(); |
| 122 | 122 | $Strategy->setApplication($app); |
| 123 | 123 | return $Strategy; |
| 124 | 124 | }; |
| 125 | 125 | |
| 126 | - $app['eccube.calculate.strategy.tax'] = function () use ($app) { |
|
| 126 | + $app['eccube.calculate.strategy.tax'] = function() use ($app) { |
|
| 127 | 127 | $Strategy = new \Eccube\Service\Calculator\Strategy\TaxStrategy(); |
| 128 | 128 | $Strategy->setApplication($app); |
| 129 | 129 | return $Strategy; |
| 130 | 130 | }; |
| 131 | 131 | |
| 132 | - $app['eccube.calculate.strategy.calculate_delivery_fee'] = function () use ($app) { |
|
| 132 | + $app['eccube.calculate.strategy.calculate_delivery_fee'] = function() use ($app) { |
|
| 133 | 133 | $Strategy = new \Eccube\Service\Calculator\Strategy\CalculateDeliveryFeeStrategy(); |
| 134 | 134 | $Strategy->setApplication($app); |
| 135 | 135 | return $Strategy; |
| 136 | 136 | }; |
| 137 | - $app['eccube.calculate.strategy.calculate_charge'] = function () use ($app) { |
|
| 137 | + $app['eccube.calculate.strategy.calculate_charge'] = function() use ($app) { |
|
| 138 | 138 | $Strategy = new \Eccube\Service\Calculator\Strategy\CalculateChargeStrategy(); |
| 139 | 139 | $Strategy->setApplication($app); |
| 140 | 140 | return $Strategy; |
| 141 | 141 | }; |
| 142 | - $app['eccube.calculate.strategy.calculate_total'] = function () use ($app) { |
|
| 142 | + $app['eccube.calculate.strategy.calculate_total'] = function() use ($app) { |
|
| 143 | 143 | $Strategy = new \Eccube\Service\Calculator\Strategy\CalculateTotalStrategy(); |
| 144 | 144 | $Strategy->setApplication($app); |
| 145 | 145 | return $Strategy; |
| 146 | 146 | }; |
| 147 | 147 | |
| 148 | - $app['payment.method'] = $app->protect(function ($clazz, $form) use ($app) { |
|
| 148 | + $app['payment.method'] = $app->protect(function($clazz, $form) use ($app) { |
|
| 149 | 149 | $PaymentMethod = new $clazz; |
| 150 | 150 | $PaymentMethod->setApplication($app); |
| 151 | 151 | $PaymentMethod->setFormType($form); |
| 152 | 152 | return $PaymentMethod; |
| 153 | 153 | }); |
| 154 | 154 | |
| 155 | - $app['payment.method.request'] = $app->protect(function ($clazz, $form, $request) use ($app) { |
|
| 155 | + $app['payment.method.request'] = $app->protect(function($clazz, $form, $request) use ($app) { |
|
| 156 | 156 | $PaymentMethod = new $clazz; |
| 157 | 157 | $PaymentMethod->setApplication($app); |
| 158 | 158 | $PaymentMethod->setFormType($form); |
@@ -160,11 +160,11 @@ discard block |
||
| 160 | 160 | return $PaymentMethod; |
| 161 | 161 | }); |
| 162 | 162 | |
| 163 | - $app['eccube.helper.order'] = function ($app) { |
|
| 163 | + $app['eccube.helper.order'] = function($app) { |
|
| 164 | 164 | return new OrderHelper($app); |
| 165 | 165 | }; |
| 166 | 166 | |
| 167 | - $app['eccube.service.csv.export'] = function () use ($app) { |
|
| 167 | + $app['eccube.service.csv.export'] = function() use ($app) { |
|
| 168 | 168 | $csvService = new \Eccube\Service\CsvExportService(); |
| 169 | 169 | $csvService->setEntityManager($app['orm.em']); |
| 170 | 170 | $csvService->setConfig($app['config']); |
@@ -176,206 +176,206 @@ discard block |
||
| 176 | 176 | |
| 177 | 177 | return $csvService; |
| 178 | 178 | }; |
| 179 | - $app['eccube.service.shopping'] = function () use ($app) { |
|
| 179 | + $app['eccube.service.shopping'] = function() use ($app) { |
|
| 180 | 180 | return new \Eccube\Service\ShoppingService($app, $app['eccube.service.cart'], $app['eccube.service.order']); |
| 181 | 181 | }; |
| 182 | 182 | |
| 183 | 183 | // Repository |
| 184 | - $app['eccube.repository.master.authority'] = function () use ($app) { |
|
| 184 | + $app['eccube.repository.master.authority'] = function() use ($app) { |
|
| 185 | 185 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Authority'); |
| 186 | 186 | }; |
| 187 | - $app['eccube.repository.master.tag'] = function () use ($app) { |
|
| 187 | + $app['eccube.repository.master.tag'] = function() use ($app) { |
|
| 188 | 188 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Tag'); |
| 189 | 189 | }; |
| 190 | - $app['eccube.repository.master.pref'] = function () use ($app) { |
|
| 190 | + $app['eccube.repository.master.pref'] = function() use ($app) { |
|
| 191 | 191 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Pref'); |
| 192 | 192 | }; |
| 193 | - $app['eccube.repository.master.sex'] = function () use ($app) { |
|
| 193 | + $app['eccube.repository.master.sex'] = function() use ($app) { |
|
| 194 | 194 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Sex'); |
| 195 | 195 | }; |
| 196 | - $app['eccube.repository.master.disp'] = function () use ($app) { |
|
| 196 | + $app['eccube.repository.master.disp'] = function() use ($app) { |
|
| 197 | 197 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Disp'); |
| 198 | 198 | }; |
| 199 | - $app['eccube.repository.master.product_type'] = function () use ($app) { |
|
| 199 | + $app['eccube.repository.master.product_type'] = function() use ($app) { |
|
| 200 | 200 | return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductType'); |
| 201 | 201 | }; |
| 202 | - $app['eccube.repository.master.page_max'] = function () use ($app) { |
|
| 202 | + $app['eccube.repository.master.page_max'] = function() use ($app) { |
|
| 203 | 203 | return $app['orm.em']->getRepository('Eccube\Entity\Master\PageMax'); |
| 204 | 204 | }; |
| 205 | - $app['eccube.repository.master.order_status'] = function () use ($app) { |
|
| 205 | + $app['eccube.repository.master.order_status'] = function() use ($app) { |
|
| 206 | 206 | }; |
| 207 | - $app['eccube.repository.master.product_list_max'] = function () use ($app) { |
|
| 207 | + $app['eccube.repository.master.product_list_max'] = function() use ($app) { |
|
| 208 | 208 | return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductListMax'); |
| 209 | 209 | }; |
| 210 | - $app['eccube.repository.master.product_list_order_by'] = function () use ($app) { |
|
| 210 | + $app['eccube.repository.master.product_list_order_by'] = function() use ($app) { |
|
| 211 | 211 | return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductListOrderBy'); |
| 212 | 212 | }; |
| 213 | - $app['eccube.repository.master.order_status'] = function () use ($app) { |
|
| 213 | + $app['eccube.repository.master.order_status'] = function() use ($app) { |
|
| 214 | 214 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus'); |
| 215 | 215 | }; |
| 216 | - $app['eccube.repository.master.device_type'] = function () use ($app) { |
|
| 216 | + $app['eccube.repository.master.device_type'] = function() use ($app) { |
|
| 217 | 217 | return $app['orm.em']->getRepository('Eccube\Entity\Master\DeviceType'); |
| 218 | 218 | }; |
| 219 | - $app['eccube.repository.master.csv_type'] = function () use ($app) { |
|
| 219 | + $app['eccube.repository.master.csv_type'] = function() use ($app) { |
|
| 220 | 220 | return $app['orm.em']->getRepository('Eccube\Entity\Master\CsvType'); |
| 221 | 221 | }; |
| 222 | - $app['eccube.repository.master.order_item_type'] = function () use ($app) { |
|
| 222 | + $app['eccube.repository.master.order_item_type'] = function() use ($app) { |
|
| 223 | 223 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderItemType'); |
| 224 | 224 | }; |
| 225 | 225 | |
| 226 | - $app['eccube.repository.delivery'] = function () use ($app) { |
|
| 226 | + $app['eccube.repository.delivery'] = function() use ($app) { |
|
| 227 | 227 | return $app['orm.em']->getRepository('Eccube\Entity\Delivery'); |
| 228 | 228 | }; |
| 229 | - $app['eccube.repository.delivery_date'] = function () use ($app) { |
|
| 229 | + $app['eccube.repository.delivery_date'] = function() use ($app) { |
|
| 230 | 230 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryDate'); |
| 231 | 231 | }; |
| 232 | - $app['eccube.repository.delivery_fee'] = function () use ($app) { |
|
| 232 | + $app['eccube.repository.delivery_fee'] = function() use ($app) { |
|
| 233 | 233 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryFee'); |
| 234 | 234 | }; |
| 235 | - $app['eccube.repository.delivery_time'] = function () use ($app) { |
|
| 235 | + $app['eccube.repository.delivery_time'] = function() use ($app) { |
|
| 236 | 236 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryTime'); |
| 237 | 237 | }; |
| 238 | - $app['eccube.repository.payment'] = function () use ($app) { |
|
| 238 | + $app['eccube.repository.payment'] = function() use ($app) { |
|
| 239 | 239 | return $app['orm.em']->getRepository('Eccube\Entity\Payment'); |
| 240 | 240 | }; |
| 241 | - $app['eccube.repository.payment_option'] = function () use ($app) { |
|
| 241 | + $app['eccube.repository.payment_option'] = function() use ($app) { |
|
| 242 | 242 | return $app['orm.em']->getRepository('Eccube\Entity\PaymentOption'); |
| 243 | 243 | }; |
| 244 | - $app['eccube.repository.category'] = function () use ($app) { |
|
| 244 | + $app['eccube.repository.category'] = function() use ($app) { |
|
| 245 | 245 | $CategoryRepository = $app['orm.em']->getRepository('Eccube\Entity\Category'); |
| 246 | 246 | $CategoryRepository->setApplication($app); |
| 247 | 247 | |
| 248 | 248 | return $CategoryRepository; |
| 249 | 249 | }; |
| 250 | - $app['eccube.repository.customer'] = function () use ($app) { |
|
| 250 | + $app['eccube.repository.customer'] = function() use ($app) { |
|
| 251 | 251 | $customerRepository = $app['orm.em']->getRepository('Eccube\Entity\Customer'); |
| 252 | 252 | $customerRepository->setApplication($app); |
| 253 | 253 | return $customerRepository; |
| 254 | 254 | }; |
| 255 | - $app['eccube.repository.news'] = function () use ($app) { |
|
| 255 | + $app['eccube.repository.news'] = function() use ($app) { |
|
| 256 | 256 | return $app['orm.em']->getRepository('Eccube\Entity\News'); |
| 257 | 257 | }; |
| 258 | - $app['eccube.repository.mail_history'] = function () use ($app) { |
|
| 258 | + $app['eccube.repository.mail_history'] = function() use ($app) { |
|
| 259 | 259 | return $app['orm.em']->getRepository('Eccube\Entity\MailHistory'); |
| 260 | 260 | }; |
| 261 | - $app['eccube.repository.member'] = function () use ($app) { |
|
| 261 | + $app['eccube.repository.member'] = function() use ($app) { |
|
| 262 | 262 | $memberRepository = $app['orm.em']->getRepository('Eccube\Entity\Member'); |
| 263 | 263 | $memberRepository->setEncoderFactorty($app['security.encoder_factory']); |
| 264 | 264 | return $memberRepository; |
| 265 | 265 | }; |
| 266 | - $app['eccube.repository.order'] = function () use ($app) { |
|
| 266 | + $app['eccube.repository.order'] = function() use ($app) { |
|
| 267 | 267 | return $app['orm.em']->getRepository('Eccube\Entity\Order'); |
| 268 | 268 | }; |
| 269 | - $app['eccube.repository.product'] = function () use ($app) { |
|
| 269 | + $app['eccube.repository.product'] = function() use ($app) { |
|
| 270 | 270 | $productRepository = $app['orm.em']->getRepository('Eccube\Entity\Product'); |
| 271 | 271 | $productRepository->setApplication($app); |
| 272 | 272 | |
| 273 | 273 | return $productRepository; |
| 274 | 274 | }; |
| 275 | - $app['eccube.repository.product_image'] = function () use ($app) { |
|
| 275 | + $app['eccube.repository.product_image'] = function() use ($app) { |
|
| 276 | 276 | return $app['orm.em']->getRepository('Eccube\Entity\ProductImage'); |
| 277 | 277 | }; |
| 278 | - $app['eccube.repository.product_class'] = function () use ($app) { |
|
| 278 | + $app['eccube.repository.product_class'] = function() use ($app) { |
|
| 279 | 279 | return $app['orm.em']->getRepository('Eccube\Entity\ProductClass'); |
| 280 | 280 | }; |
| 281 | - $app['eccube.repository.product_stock'] = function () use ($app) { |
|
| 281 | + $app['eccube.repository.product_stock'] = function() use ($app) { |
|
| 282 | 282 | return $app['orm.em']->getRepository('Eccube\Entity\ProductStock'); |
| 283 | 283 | }; |
| 284 | - $app['eccube.repository.product_tag'] = function () use ($app) { |
|
| 284 | + $app['eccube.repository.product_tag'] = function() use ($app) { |
|
| 285 | 285 | return $app['orm.em']->getRepository('Eccube\Entity\ProductTag'); |
| 286 | 286 | }; |
| 287 | - $app['eccube.repository.class_name'] = function () use ($app) { |
|
| 287 | + $app['eccube.repository.class_name'] = function() use ($app) { |
|
| 288 | 288 | return $app['orm.em']->getRepository('Eccube\Entity\ClassName'); |
| 289 | 289 | }; |
| 290 | - $app['eccube.repository.class_category'] = function () use ($app) { |
|
| 290 | + $app['eccube.repository.class_category'] = function() use ($app) { |
|
| 291 | 291 | return $app['orm.em']->getRepository('Eccube\Entity\ClassCategory'); |
| 292 | 292 | }; |
| 293 | - $app['eccube.repository.customer_favorite_product'] = function () use ($app) { |
|
| 293 | + $app['eccube.repository.customer_favorite_product'] = function() use ($app) { |
|
| 294 | 294 | return $app['orm.em']->getRepository('Eccube\Entity\CustomerFavoriteProduct'); |
| 295 | 295 | }; |
| 296 | - $app['eccube.repository.base_info'] = function () use ($app) { |
|
| 296 | + $app['eccube.repository.base_info'] = function() use ($app) { |
|
| 297 | 297 | $BaseInfoRepository = $app['orm.em']->getRepository('Eccube\Entity\BaseInfo'); |
| 298 | 298 | $BaseInfoRepository->setApplication($app); |
| 299 | 299 | |
| 300 | 300 | return $BaseInfoRepository; |
| 301 | 301 | }; |
| 302 | - $app['eccube.repository.tax_rule'] = function () use ($app) { |
|
| 302 | + $app['eccube.repository.tax_rule'] = function() use ($app) { |
|
| 303 | 303 | $taxRuleRepository = $app['orm.em']->getRepository('Eccube\Entity\TaxRule'); |
| 304 | 304 | $taxRuleRepository->setApplication($app); |
| 305 | 305 | |
| 306 | 306 | return $taxRuleRepository; |
| 307 | 307 | }; |
| 308 | - $app['eccube.repository.page_layout'] = function () use ($app) { |
|
| 308 | + $app['eccube.repository.page_layout'] = function() use ($app) { |
|
| 309 | 309 | $pageLayoutRepository = $app['orm.em']->getRepository('Eccube\Entity\PageLayout'); |
| 310 | 310 | $pageLayoutRepository->setApplication($app); |
| 311 | 311 | |
| 312 | 312 | return $pageLayoutRepository; |
| 313 | 313 | }; |
| 314 | - $app['eccube.repository.block'] = function () use ($app) { |
|
| 314 | + $app['eccube.repository.block'] = function() use ($app) { |
|
| 315 | 315 | $blockRepository = $app['orm.em']->getRepository('Eccube\Entity\Block'); |
| 316 | 316 | $blockRepository->setApplication($app); |
| 317 | 317 | |
| 318 | 318 | return $blockRepository; |
| 319 | 319 | }; |
| 320 | - $app['eccube.repository.order'] = function () use ($app) { |
|
| 320 | + $app['eccube.repository.order'] = function() use ($app) { |
|
| 321 | 321 | $orderRepository = $app['orm.em']->getRepository('Eccube\Entity\Order'); |
| 322 | 322 | $orderRepository->setApplication($app); |
| 323 | 323 | |
| 324 | 324 | return $orderRepository; |
| 325 | 325 | }; |
| 326 | - $app['eccube.repository.customer_address'] = function () use ($app) { |
|
| 326 | + $app['eccube.repository.customer_address'] = function() use ($app) { |
|
| 327 | 327 | return $app['orm.em']->getRepository('Eccube\Entity\CustomerAddress'); |
| 328 | 328 | }; |
| 329 | - $app['eccube.repository.shipping'] = function () use ($app) { |
|
| 329 | + $app['eccube.repository.shipping'] = function() use ($app) { |
|
| 330 | 330 | return $app['orm.em']->getRepository('Eccube\Entity\Shipping'); |
| 331 | 331 | }; |
| 332 | - $app['eccube.repository.shipment_item'] = function () use ($app) { |
|
| 332 | + $app['eccube.repository.shipment_item'] = function() use ($app) { |
|
| 333 | 333 | return $app['orm.em']->getRepository('Eccube\Entity\ShipmentItem'); |
| 334 | 334 | }; |
| 335 | - $app['eccube.repository.customer_status'] = function () use ($app) { |
|
| 335 | + $app['eccube.repository.customer_status'] = function() use ($app) { |
|
| 336 | 336 | return $app['orm.em']->getRepository('Eccube\Entity\Master\CustomerStatus'); |
| 337 | 337 | }; |
| 338 | - $app['eccube.repository.order_status'] = function () use ($app) { |
|
| 338 | + $app['eccube.repository.order_status'] = function() use ($app) { |
|
| 339 | 339 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus'); |
| 340 | 340 | }; |
| 341 | - $app['eccube.repository.mail_template'] = function () use ($app) { |
|
| 341 | + $app['eccube.repository.mail_template'] = function() use ($app) { |
|
| 342 | 342 | return $app['orm.em']->getRepository('Eccube\Entity\MailTemplate'); |
| 343 | 343 | }; |
| 344 | - $app['eccube.repository.csv'] = function () use ($app) { |
|
| 344 | + $app['eccube.repository.csv'] = function() use ($app) { |
|
| 345 | 345 | return $app['orm.em']->getRepository('Eccube\Entity\Csv'); |
| 346 | 346 | }; |
| 347 | - $app['eccube.repository.template'] = function () use ($app) { |
|
| 347 | + $app['eccube.repository.template'] = function() use ($app) { |
|
| 348 | 348 | return $app['orm.em']->getRepository('Eccube\Entity\Template'); |
| 349 | 349 | }; |
| 350 | - $app['eccube.repository.authority_role'] = function () use ($app) { |
|
| 350 | + $app['eccube.repository.authority_role'] = function() use ($app) { |
|
| 351 | 351 | return $app['orm.em']->getRepository('Eccube\Entity\AuthorityRole'); |
| 352 | 352 | }; |
| 353 | 353 | |
| 354 | - $app['paginator'] = $app->protect(function () { |
|
| 354 | + $app['paginator'] = $app->protect(function() { |
|
| 355 | 355 | $paginator = new \Knp\Component\Pager\Paginator(); |
| 356 | 356 | $paginator->subscribe(new \Eccube\EventListener\PaginatorListener()); |
| 357 | 357 | |
| 358 | 358 | return $paginator; |
| 359 | 359 | }); |
| 360 | 360 | |
| 361 | - $app['eccube.repository.help'] = function () use ($app) { |
|
| 361 | + $app['eccube.repository.help'] = function() use ($app) { |
|
| 362 | 362 | return $app['orm.em']->getRepository('Eccube\Entity\Help'); |
| 363 | 363 | }; |
| 364 | - $app['eccube.repository.plugin'] = function () use ($app) { |
|
| 364 | + $app['eccube.repository.plugin'] = function() use ($app) { |
|
| 365 | 365 | return $app['orm.em']->getRepository('Eccube\Entity\Plugin'); |
| 366 | 366 | }; |
| 367 | - $app['eccube.repository.plugin_event_handler'] = function () use ($app) { |
|
| 367 | + $app['eccube.repository.plugin_event_handler'] = function() use ($app) { |
|
| 368 | 368 | return $app['orm.em']->getRepository('Eccube\Entity\PluginEventHandler'); |
| 369 | 369 | }; |
| 370 | - $app['eccube.repository.layout'] = function () use ($app) { |
|
| 370 | + $app['eccube.repository.layout'] = function() use ($app) { |
|
| 371 | 371 | return $app['orm.em']->getRepository('Eccube\Entity\Layout'); |
| 372 | 372 | }; |
| 373 | 373 | |
| 374 | - $app['request_scope'] = function () { |
|
| 374 | + $app['request_scope'] = function() { |
|
| 375 | 375 | return new ParameterBag(); |
| 376 | 376 | }; |
| 377 | 377 | // TODO 使用するか検討 |
| 378 | - $app['eccube.twig.node.hello'] = $app->protect(function ($node, $compiler) { |
|
| 378 | + $app['eccube.twig.node.hello'] = $app->protect(function($node, $compiler) { |
|
| 379 | 379 | $compiler |
| 380 | 380 | ->addDebugInfo($node) |
| 381 | 381 | ->write("echo 'Helloooooo ' . ") |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | |
| 386 | 386 | }); |
| 387 | 387 | // TODO 使用するか検討 |
| 388 | - $app['eccube.twig.node.jiro'] = $app->protect(function ($node, $compiler) { |
|
| 388 | + $app['eccube.twig.node.jiro'] = $app->protect(function($node, $compiler) { |
|
| 389 | 389 | $compiler |
| 390 | 390 | ->addDebugInfo($node) |
| 391 | 391 | ->write("echo 'jirooooooo ' . ") |
@@ -396,7 +396,7 @@ discard block |
||
| 396 | 396 | }); |
| 397 | 397 | |
| 398 | 398 | // TODO 使用するか検討 |
| 399 | - $app['eccube.twig.generic_node_names'] = function () use ($app) { |
|
| 399 | + $app['eccube.twig.generic_node_names'] = function() use ($app) { |
|
| 400 | 400 | return [ |
| 401 | 401 | 'hello', |
| 402 | 402 | 'jiro', |
@@ -405,7 +405,7 @@ discard block |
||
| 405 | 405 | }; |
| 406 | 406 | |
| 407 | 407 | // TODO 使用するか検討 |
| 408 | - $app['twig_parsers'] = function () use ($app) { |
|
| 408 | + $app['twig_parsers'] = function() use ($app) { |
|
| 409 | 409 | $GenericTokenParsers = []; |
| 410 | 410 | foreach ($app['eccube.twig.generic_node_names'] as $tagName) { |
| 411 | 411 | $GenericTokenParsers[] = new \Eccube\Twig\Extension\GenericTokenParser($app, $tagName); |
@@ -414,20 +414,20 @@ discard block |
||
| 414 | 414 | }; |
| 415 | 415 | |
| 416 | 416 | // TODO ServiceProvider から追加できるよう Collection にする |
| 417 | - $app['eccube.twig.block.templates'] = function () { |
|
| 417 | + $app['eccube.twig.block.templates'] = function() { |
|
| 418 | 418 | return [ |
| 419 | 419 | 'render_block.twig', |
| 420 | 420 | ]; |
| 421 | 421 | }; |
| 422 | 422 | |
| 423 | 423 | // Form\Type |
| 424 | - $app->extend('form.type.extensions', function ($extensions) use ($app) { |
|
| 424 | + $app->extend('form.type.extensions', function($extensions) use ($app) { |
|
| 425 | 425 | $extensions[] = new \Eccube\Form\Extension\HelpTypeExtension(); |
| 426 | 426 | $extensions[] = new \Eccube\Form\Extension\FreezeTypeExtension(); |
| 427 | 427 | $extensions[] = new \Eccube\Form\Extension\DoctrineOrmExtension($app['orm.em']); |
| 428 | 428 | return $extensions; |
| 429 | 429 | }); |
| 430 | - $app->extend('form.types', function ($types) use ($app) { |
|
| 430 | + $app->extend('form.types', function($types) use ($app) { |
|
| 431 | 431 | $types[] = new \Eccube\Form\Type\NameType($app['config']); |
| 432 | 432 | $types[] = new \Eccube\Form\Type\KanaType($app['config']); |
| 433 | 433 | $types[] = new \Eccube\Form\Type\TelType($app['config']); |
@@ -531,13 +531,13 @@ discard block |
||
| 531 | 531 | return $types; |
| 532 | 532 | }); |
| 533 | 533 | $app['eccube.entity.event.dispatcher']->addEventListener(new \Acme\Entity\SoldOutEventListener()); |
| 534 | - $app['eccube.queries'] = function () { |
|
| 534 | + $app['eccube.queries'] = function() { |
|
| 535 | 535 | return new \Eccube\Doctrine\Query\Queries(); |
| 536 | 536 | }; |
| 537 | 537 | // TODO QueryCustomizerの追加方法は要検討 |
| 538 | 538 | $app['eccube.queries']->addCustomizer(new \Acme\Entity\AdminProductListCustomizer()); |
| 539 | 539 | |
| 540 | - $app['eccube.purchase.flow.cart.item_processors'] = function ($app) { |
|
| 540 | + $app['eccube.purchase.flow.cart.item_processors'] = function($app) { |
|
| 541 | 541 | $processors = new ArrayCollection(); |
| 542 | 542 | $processors->add(new DeletedProductValidator()); |
| 543 | 543 | $processors->add(new DisplayStatusValidator()); |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | return $processors; |
| 548 | 548 | }; |
| 549 | 549 | |
| 550 | - $app['eccube.purchase.flow.cart.holder_processors'] = function ($app) { |
|
| 550 | + $app['eccube.purchase.flow.cart.holder_processors'] = function($app) { |
|
| 551 | 551 | $processors = new ArrayCollection(); |
| 552 | 552 | $processors->add(new PaymentProcessor($app)); |
| 553 | 553 | $processors->add(new PaymentTotalLimitValidator($app['config']['max_total_fee'])); |
@@ -558,14 +558,14 @@ discard block |
||
| 558 | 558 | }; |
| 559 | 559 | |
| 560 | 560 | // example |
| 561 | - $app->extend('eccube.purchase.flow.cart.item_processors', function ($processors, $app) { |
|
| 561 | + $app->extend('eccube.purchase.flow.cart.item_processors', function($processors, $app) { |
|
| 562 | 562 | |
| 563 | 563 | $processors->add(new StockValidator()); |
| 564 | 564 | |
| 565 | 565 | return $processors; |
| 566 | 566 | }); |
| 567 | 567 | |
| 568 | - $app['eccube.purchase.flow.cart'] = function ($app) { |
|
| 568 | + $app['eccube.purchase.flow.cart'] = function($app) { |
|
| 569 | 569 | $flow = new PurchaseFlow(); |
| 570 | 570 | $flow->setItemProcessors($app['eccube.purchase.flow.cart.item_processors']); |
| 571 | 571 | $flow->setItemHolderProcessors($app['eccube.purchase.flow.cart.holder_processors']); |
@@ -573,7 +573,7 @@ discard block |
||
| 573 | 573 | return $flow; |
| 574 | 574 | }; |
| 575 | 575 | |
| 576 | - $app['eccube.purchase.flow.shopping'] = function () use ($app) { |
|
| 576 | + $app['eccube.purchase.flow.shopping'] = function() use ($app) { |
|
| 577 | 577 | $flow = new PurchaseFlow(); |
| 578 | 578 | $flow->addItemProcessor(new StockValidator()); |
| 579 | 579 | $flow->addItemProcessor(new DisplayStatusValidator()); |
@@ -583,7 +583,7 @@ discard block |
||
| 583 | 583 | return $flow; |
| 584 | 584 | }; |
| 585 | 585 | |
| 586 | - $app['eccube.purchase.flow.order'] = function () use ($app) { |
|
| 586 | + $app['eccube.purchase.flow.order'] = function() use ($app) { |
|
| 587 | 587 | $flow = new PurchaseFlow(); |
| 588 | 588 | $flow->addItemProcessor(new StockValidator()); |
| 589 | 589 | $flow->addItemHolderProcessor(new PaymentTotalLimitValidator($app['config']['max_total_fee'])); |
@@ -40,14 +40,14 @@ |
||
| 40 | 40 | $eventName = $view; |
| 41 | 41 | if ($this->isAdminRequest()) { |
| 42 | 42 | // 管理画面の場合、event名に「Admin/」を付ける |
| 43 | - $eventName = 'Admin/' . $view; |
|
| 43 | + $eventName = 'Admin/'.$view; |
|
| 44 | 44 | } |
| 45 | - $this['monolog']->debug('Template Event Name : ' . $eventName); |
|
| 45 | + $this['monolog']->debug('Template Event Name : '.$eventName); |
|
| 46 | 46 | |
| 47 | 47 | // $this['eccube.event.dispatcher']->dispatch($eventName, $event); |
| 48 | 48 | |
| 49 | 49 | if ($response instanceof StreamedResponse) { |
| 50 | - $response->setCallback(function () use ($twig, $view, $parameters) { |
|
| 50 | + $response->setCallback(function() use ($twig, $view, $parameters) { |
|
| 51 | 51 | $twig->display($view, $parameters); |
| 52 | 52 | }); |
| 53 | 53 | } else { |
@@ -22,17 +22,17 @@ discard block |
||
| 22 | 22 | $app->register(new \Silex\Provider\MonologServiceProvider()); |
| 23 | 23 | |
| 24 | 24 | // Log |
| 25 | - $app['eccube.logger'] = function ($app) { |
|
| 25 | + $app['eccube.logger'] = function($app) { |
|
| 26 | 26 | return new Logger($app); |
| 27 | 27 | }; |
| 28 | 28 | |
| 29 | 29 | // ヘルパー作成 |
| 30 | - $app['eccube.monolog.helper'] = function ($app) { |
|
| 30 | + $app['eccube.monolog.helper'] = function($app) { |
|
| 31 | 31 | return new LogHelper($app); |
| 32 | 32 | }; |
| 33 | 33 | |
| 34 | 34 | // ログクラス作成ファクトリー |
| 35 | - $app['eccube.monolog.factory'] = $app->protect(function (array $channelValues) use ($app) { |
|
| 35 | + $app['eccube.monolog.factory'] = $app->protect(function(array $channelValues) use ($app) { |
|
| 36 | 36 | |
| 37 | 37 | $log = new $app['monolog.logger.class']($channelValues['name']); |
| 38 | 38 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | // monologの設定は除外 |
| 48 | 48 | unset($channels['monolog']); |
| 49 | 49 | foreach ($channels as $channel => $channelValues) { |
| 50 | - $app['monolog.logger.'.$channel] = function ($app) use ($channelValues) { |
|
| 50 | + $app['monolog.logger.'.$channel] = function($app) use ($channelValues) { |
|
| 51 | 51 | return $app['eccube.monolog.factory']($channelValues); |
| 52 | 52 | }; |
| 53 | 53 | } |
@@ -55,15 +55,15 @@ discard block |
||
| 55 | 55 | // MonologServiceProviderで定義されているmonolog.handlerの置換 |
| 56 | 56 | $channelValues = $app['config']['log']['channel']['monolog']; |
| 57 | 57 | $app['monolog.name'] = $channelValues['name']; |
| 58 | - $app['monolog.handler'] = function ($app) use ($channelValues) { |
|
| 58 | + $app['monolog.handler'] = function($app) use ($channelValues) { |
|
| 59 | 59 | return $app['eccube.monolog.helper']->getHandler($channelValues); |
| 60 | 60 | }; |
| 61 | 61 | |
| 62 | - $app['eccube.monolog.listener'] = function () use ($app) { |
|
| 62 | + $app['eccube.monolog.listener'] = function() use ($app) { |
|
| 63 | 63 | return new LogListener($app['eccube.logger']); |
| 64 | 64 | }; |
| 65 | 65 | |
| 66 | - $app['listener.requestdump'] = function ($app) { |
|
| 66 | + $app['listener.requestdump'] = function($app) { |
|
| 67 | 67 | return new \Eccube\EventListener\RequestDumpListener($app); |
| 68 | 68 | }; |
| 69 | 69 | } |
@@ -42,13 +42,13 @@ |
||
| 42 | 42 | */ |
| 43 | 43 | public function register(Container $app) |
| 44 | 44 | { |
| 45 | - $app->extend('form.type.extensions', function ($extensions) use ($app) { |
|
| 45 | + $app->extend('form.type.extensions', function($extensions) use ($app) { |
|
| 46 | 46 | $extensions[] = new \Eccube\Form\Extension\HelpTypeExtension(); |
| 47 | 47 | |
| 48 | 48 | return $extensions; |
| 49 | 49 | }); |
| 50 | 50 | |
| 51 | - $app->extend('form.types', function ($types) use ($app) { |
|
| 51 | + $app->extend('form.types', function($types) use ($app) { |
|
| 52 | 52 | $types[] = new \Eccube\Form\Type\Install\Step1Type($app); |
| 53 | 53 | $types[] = new \Eccube\Form\Type\Install\Step3Type($app); |
| 54 | 54 | $types[] = new \Eccube\Form\Type\Install\Step4Type($app); |