@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | * @param array $metadatas |
| 349 | 349 | * @param array $fsList |
| 350 | 350 | * @param $pluginCode |
| 351 | - * @param $codePath |
|
| 351 | + * @param string $codePath |
|
| 352 | 352 | */ |
| 353 | 353 | protected function generateMigration(array $metadatas, array &$fsList = array(), $pluginCode, $codePath) |
| 354 | 354 | { |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | * |
| 374 | 374 | * @param $pluginCode |
| 375 | 375 | * @param array $metadatas |
| 376 | - * @return mixed|string |
|
| 376 | + * @return string |
|
| 377 | 377 | */ |
| 378 | 378 | protected function makeMigration($pluginCode, array $metadatas) |
| 379 | 379 | { |
@@ -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 | { |
@@ -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 | { |
@@ -32,6 +33,9 @@ discard block |
||
| 32 | 33 | $this['session']->getFlashBag()->add('eccube.' . $namespace . '.danger', $message); |
| 33 | 34 | } |
| 34 | 35 | |
| 36 | + /** |
|
| 37 | + * @param string $message |
|
| 38 | + */ |
|
| 35 | 39 | public function addWarning($message, $namespace = 'front') |
| 36 | 40 | { |
| 37 | 41 | $this['session']->getFlashBag()->add('eccube.' . $namespace . '.warning', $message); |
@@ -42,6 +46,9 @@ discard block |
||
| 42 | 46 | $this['session']->getFlashBag()->add('eccube.' . $namespace . '.info', $message); |
| 43 | 47 | } |
| 44 | 48 | |
| 49 | + /** |
|
| 50 | + * @param string $message |
|
| 51 | + */ |
|
| 45 | 52 | public function addRequestError($message, $namespace = 'front') |
| 46 | 53 | { |
| 47 | 54 | $this['session']->getFlashBag()->set('eccube.' . $namespace . '.request.error', $message); |
@@ -58,6 +65,9 @@ discard block |
||
| 58 | 65 | $this->addWarning('admin.delete.warning', 'admin'); |
| 59 | 66 | } |
| 60 | 67 | |
| 68 | + /** |
|
| 69 | + * @param string $targetPath |
|
| 70 | + */ |
|
| 61 | 71 | public function setLoginTargetPath($targetPath, $namespace = null) |
| 62 | 72 | { |
| 63 | 73 | if (is_null($namespace)) { |
@@ -109,7 +119,7 @@ discard block |
||
| 109 | 119 | * @param string $path フォワード先のパス |
| 110 | 120 | * @param array $requestParameters |
| 111 | 121 | * @param Response $response |
| 112 | - * @return Application |
|
| 122 | + * @return ApplicationTrait |
|
| 113 | 123 | */ |
| 114 | 124 | public function forwardChain($path, array $requestParameters = [], Response &$response = null) |
| 115 | 125 | { |
@@ -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; |
@@ -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 | { |
@@ -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 | $app['eccube.calculate.strategies']->setOrder($Order); |
@@ -79,13 +79,13 @@ discard block |
||
| 79 | 79 | return $Service; |
| 80 | 80 | }); |
| 81 | 81 | |
| 82 | - $app['eccube.service.payment'] = $app->protect(function ($clazz) use ($app) { |
|
| 82 | + $app['eccube.service.payment'] = $app->protect(function($clazz) use ($app) { |
|
| 83 | 83 | $Service = new $clazz; |
| 84 | 84 | $Service->setApplication($app); |
| 85 | 85 | return $Service; |
| 86 | 86 | }); |
| 87 | 87 | |
| 88 | - $app['eccube.calculate.strategies'] = function () use ($app) { |
|
| 88 | + $app['eccube.calculate.strategies'] = function() use ($app) { |
|
| 89 | 89 | $Collection = new \Eccube\Service\Calculator\CalculateStrategyCollection(); |
| 90 | 90 | $Collection->setApplication($app); |
| 91 | 91 | //$Collection->setOrder($Order); |
@@ -94,25 +94,25 @@ discard block |
||
| 94 | 94 | $Collection->add($app['eccube.calculate.strategy.tax']); |
| 95 | 95 | return $Collection; |
| 96 | 96 | }; |
| 97 | - $app['eccube.calculate.strategy.shipping'] = function () use ($app) { |
|
| 97 | + $app['eccube.calculate.strategy.shipping'] = function() use ($app) { |
|
| 98 | 98 | $Strategy = new \Eccube\Service\Calculator\Strategy\ShippingStrategy(); |
| 99 | 99 | $Strategy->setApplication($app); |
| 100 | 100 | return $Strategy; |
| 101 | 101 | }; |
| 102 | - $app['eccube.calculate.strategy.tax'] = function () use ($app) { |
|
| 102 | + $app['eccube.calculate.strategy.tax'] = function() use ($app) { |
|
| 103 | 103 | $Strategy = new \Eccube\Service\Calculator\Strategy\TaxStrategy(); |
| 104 | 104 | $Strategy->setApplication($app); |
| 105 | 105 | return $Strategy; |
| 106 | 106 | }; |
| 107 | 107 | |
| 108 | - $app['payment.method'] = $app->protect(function ($clazz, $form) use ($app) { |
|
| 108 | + $app['payment.method'] = $app->protect(function($clazz, $form) use ($app) { |
|
| 109 | 109 | $PaymentMethod = new $clazz; |
| 110 | 110 | $PaymentMethod->setApplication($app); |
| 111 | 111 | $PaymentMethod->setFormType($form); |
| 112 | 112 | return $PaymentMethod; |
| 113 | 113 | }); |
| 114 | 114 | |
| 115 | - $app['payment.method.request'] = $app->protect(function ($clazz, $form, $request) use ($app) { |
|
| 115 | + $app['payment.method.request'] = $app->protect(function($clazz, $form, $request) use ($app) { |
|
| 116 | 116 | $PaymentMethod = new $clazz; |
| 117 | 117 | $PaymentMethod->setApplication($app); |
| 118 | 118 | $PaymentMethod->setFormType($form); |
@@ -120,11 +120,11 @@ discard block |
||
| 120 | 120 | return $PaymentMethod; |
| 121 | 121 | }); |
| 122 | 122 | |
| 123 | - $app['eccube.helper.order'] = function ($app) { |
|
| 123 | + $app['eccube.helper.order'] = function($app) { |
|
| 124 | 124 | return new OrderHelper($app); |
| 125 | 125 | }; |
| 126 | 126 | |
| 127 | - $app['eccube.service.csv.export'] = function () use ($app) { |
|
| 127 | + $app['eccube.service.csv.export'] = function() use ($app) { |
|
| 128 | 128 | $csvService = new \Eccube\Service\CsvExportService(); |
| 129 | 129 | $csvService->setEntityManager($app['orm.em']); |
| 130 | 130 | $csvService->setConfig($app['config']); |
@@ -136,206 +136,206 @@ discard block |
||
| 136 | 136 | |
| 137 | 137 | return $csvService; |
| 138 | 138 | }; |
| 139 | - $app['eccube.service.shopping'] = function () use ($app) { |
|
| 139 | + $app['eccube.service.shopping'] = function() use ($app) { |
|
| 140 | 140 | return new \Eccube\Service\ShoppingService($app, $app['eccube.service.cart'], $app['eccube.service.order']); |
| 141 | 141 | }; |
| 142 | 142 | |
| 143 | 143 | // Repository |
| 144 | - $app['eccube.repository.master.authority'] = function () use ($app) { |
|
| 144 | + $app['eccube.repository.master.authority'] = function() use ($app) { |
|
| 145 | 145 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Authority'); |
| 146 | 146 | }; |
| 147 | - $app['eccube.repository.master.tag'] = function () use ($app) { |
|
| 147 | + $app['eccube.repository.master.tag'] = function() use ($app) { |
|
| 148 | 148 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Tag'); |
| 149 | 149 | }; |
| 150 | - $app['eccube.repository.master.pref'] = function () use ($app) { |
|
| 150 | + $app['eccube.repository.master.pref'] = function() use ($app) { |
|
| 151 | 151 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Pref'); |
| 152 | 152 | }; |
| 153 | - $app['eccube.repository.master.sex'] = function () use ($app) { |
|
| 153 | + $app['eccube.repository.master.sex'] = function() use ($app) { |
|
| 154 | 154 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Sex'); |
| 155 | 155 | }; |
| 156 | - $app['eccube.repository.master.disp'] = function () use ($app) { |
|
| 156 | + $app['eccube.repository.master.disp'] = function() use ($app) { |
|
| 157 | 157 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Disp'); |
| 158 | 158 | }; |
| 159 | - $app['eccube.repository.master.product_type'] = function () use ($app) { |
|
| 159 | + $app['eccube.repository.master.product_type'] = function() use ($app) { |
|
| 160 | 160 | return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductType'); |
| 161 | 161 | }; |
| 162 | - $app['eccube.repository.master.page_max'] = function () use ($app) { |
|
| 162 | + $app['eccube.repository.master.page_max'] = function() use ($app) { |
|
| 163 | 163 | return $app['orm.em']->getRepository('Eccube\Entity\Master\PageMax'); |
| 164 | 164 | }; |
| 165 | - $app['eccube.repository.master.order_status'] = function () use ($app) { |
|
| 165 | + $app['eccube.repository.master.order_status'] = function() use ($app) { |
|
| 166 | 166 | }; |
| 167 | - $app['eccube.repository.master.product_list_max'] = function () use ($app) { |
|
| 167 | + $app['eccube.repository.master.product_list_max'] = function() use ($app) { |
|
| 168 | 168 | return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductListMax'); |
| 169 | 169 | }; |
| 170 | - $app['eccube.repository.master.product_list_order_by'] = function () use ($app) { |
|
| 170 | + $app['eccube.repository.master.product_list_order_by'] = function() use ($app) { |
|
| 171 | 171 | return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductListOrderBy'); |
| 172 | 172 | }; |
| 173 | - $app['eccube.repository.master.order_status'] = function () use ($app) { |
|
| 173 | + $app['eccube.repository.master.order_status'] = function() use ($app) { |
|
| 174 | 174 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus'); |
| 175 | 175 | }; |
| 176 | - $app['eccube.repository.master.device_type'] = function () use ($app) { |
|
| 176 | + $app['eccube.repository.master.device_type'] = function() use ($app) { |
|
| 177 | 177 | return $app['orm.em']->getRepository('Eccube\Entity\Master\DeviceType'); |
| 178 | 178 | }; |
| 179 | - $app['eccube.repository.master.csv_type'] = function () use ($app) { |
|
| 179 | + $app['eccube.repository.master.csv_type'] = function() use ($app) { |
|
| 180 | 180 | return $app['orm.em']->getRepository('Eccube\Entity\Master\CsvType'); |
| 181 | 181 | }; |
| 182 | - $app['eccube.repository.master.order_item_type'] = function () use ($app) { |
|
| 182 | + $app['eccube.repository.master.order_item_type'] = function() use ($app) { |
|
| 183 | 183 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderItemType'); |
| 184 | 184 | }; |
| 185 | 185 | |
| 186 | - $app['eccube.repository.delivery'] = function () use ($app) { |
|
| 186 | + $app['eccube.repository.delivery'] = function() use ($app) { |
|
| 187 | 187 | return $app['orm.em']->getRepository('Eccube\Entity\Delivery'); |
| 188 | 188 | }; |
| 189 | - $app['eccube.repository.delivery_date'] = function () use ($app) { |
|
| 189 | + $app['eccube.repository.delivery_date'] = function() use ($app) { |
|
| 190 | 190 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryDate'); |
| 191 | 191 | }; |
| 192 | - $app['eccube.repository.delivery_fee'] = function () use ($app) { |
|
| 192 | + $app['eccube.repository.delivery_fee'] = function() use ($app) { |
|
| 193 | 193 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryFee'); |
| 194 | 194 | }; |
| 195 | - $app['eccube.repository.delivery_time'] = function () use ($app) { |
|
| 195 | + $app['eccube.repository.delivery_time'] = function() use ($app) { |
|
| 196 | 196 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryTime'); |
| 197 | 197 | }; |
| 198 | - $app['eccube.repository.payment'] = function () use ($app) { |
|
| 198 | + $app['eccube.repository.payment'] = function() use ($app) { |
|
| 199 | 199 | return $app['orm.em']->getRepository('Eccube\Entity\Payment'); |
| 200 | 200 | }; |
| 201 | - $app['eccube.repository.payment_option'] = function () use ($app) { |
|
| 201 | + $app['eccube.repository.payment_option'] = function() use ($app) { |
|
| 202 | 202 | return $app['orm.em']->getRepository('Eccube\Entity\PaymentOption'); |
| 203 | 203 | }; |
| 204 | - $app['eccube.repository.category'] = function () use ($app) { |
|
| 204 | + $app['eccube.repository.category'] = function() use ($app) { |
|
| 205 | 205 | $CategoryRepository = $app['orm.em']->getRepository('Eccube\Entity\Category'); |
| 206 | 206 | $CategoryRepository->setApplication($app); |
| 207 | 207 | |
| 208 | 208 | return $CategoryRepository; |
| 209 | 209 | }; |
| 210 | - $app['eccube.repository.customer'] = function () use ($app) { |
|
| 210 | + $app['eccube.repository.customer'] = function() use ($app) { |
|
| 211 | 211 | $customerRepository = $app['orm.em']->getRepository('Eccube\Entity\Customer'); |
| 212 | 212 | $customerRepository->setApplication($app); |
| 213 | 213 | return $customerRepository; |
| 214 | 214 | }; |
| 215 | - $app['eccube.repository.news'] = function () use ($app) { |
|
| 215 | + $app['eccube.repository.news'] = function() use ($app) { |
|
| 216 | 216 | return $app['orm.em']->getRepository('Eccube\Entity\News'); |
| 217 | 217 | }; |
| 218 | - $app['eccube.repository.mail_history'] = function () use ($app) { |
|
| 218 | + $app['eccube.repository.mail_history'] = function() use ($app) { |
|
| 219 | 219 | return $app['orm.em']->getRepository('Eccube\Entity\MailHistory'); |
| 220 | 220 | }; |
| 221 | - $app['eccube.repository.member'] = function () use ($app) { |
|
| 221 | + $app['eccube.repository.member'] = function() use ($app) { |
|
| 222 | 222 | $memberRepository = $app['orm.em']->getRepository('Eccube\Entity\Member'); |
| 223 | 223 | $memberRepository->setEncoderFactorty($app['security.encoder_factory']); |
| 224 | 224 | return $memberRepository; |
| 225 | 225 | }; |
| 226 | - $app['eccube.repository.order'] = function () use ($app) { |
|
| 226 | + $app['eccube.repository.order'] = function() use ($app) { |
|
| 227 | 227 | return $app['orm.em']->getRepository('Eccube\Entity\Order'); |
| 228 | 228 | }; |
| 229 | - $app['eccube.repository.product'] = function () use ($app) { |
|
| 229 | + $app['eccube.repository.product'] = function() use ($app) { |
|
| 230 | 230 | $productRepository = $app['orm.em']->getRepository('Eccube\Entity\Product'); |
| 231 | 231 | $productRepository->setApplication($app); |
| 232 | 232 | |
| 233 | 233 | return $productRepository; |
| 234 | 234 | }; |
| 235 | - $app['eccube.repository.product_image'] = function () use ($app) { |
|
| 235 | + $app['eccube.repository.product_image'] = function() use ($app) { |
|
| 236 | 236 | return $app['orm.em']->getRepository('Eccube\Entity\ProductImage'); |
| 237 | 237 | }; |
| 238 | - $app['eccube.repository.product_class'] = function () use ($app) { |
|
| 238 | + $app['eccube.repository.product_class'] = function() use ($app) { |
|
| 239 | 239 | return $app['orm.em']->getRepository('Eccube\Entity\ProductClass'); |
| 240 | 240 | }; |
| 241 | - $app['eccube.repository.product_stock'] = function () use ($app) { |
|
| 241 | + $app['eccube.repository.product_stock'] = function() use ($app) { |
|
| 242 | 242 | return $app['orm.em']->getRepository('Eccube\Entity\ProductStock'); |
| 243 | 243 | }; |
| 244 | - $app['eccube.repository.product_tag'] = function () use ($app) { |
|
| 244 | + $app['eccube.repository.product_tag'] = function() use ($app) { |
|
| 245 | 245 | return $app['orm.em']->getRepository('Eccube\Entity\ProductTag'); |
| 246 | 246 | }; |
| 247 | - $app['eccube.repository.class_name'] = function () use ($app) { |
|
| 247 | + $app['eccube.repository.class_name'] = function() use ($app) { |
|
| 248 | 248 | return $app['orm.em']->getRepository('Eccube\Entity\ClassName'); |
| 249 | 249 | }; |
| 250 | - $app['eccube.repository.class_category'] = function () use ($app) { |
|
| 250 | + $app['eccube.repository.class_category'] = function() use ($app) { |
|
| 251 | 251 | return $app['orm.em']->getRepository('Eccube\Entity\ClassCategory'); |
| 252 | 252 | }; |
| 253 | - $app['eccube.repository.customer_favorite_product'] = function () use ($app) { |
|
| 253 | + $app['eccube.repository.customer_favorite_product'] = function() use ($app) { |
|
| 254 | 254 | return $app['orm.em']->getRepository('Eccube\Entity\CustomerFavoriteProduct'); |
| 255 | 255 | }; |
| 256 | - $app['eccube.repository.base_info'] = function () use ($app) { |
|
| 256 | + $app['eccube.repository.base_info'] = function() use ($app) { |
|
| 257 | 257 | $BaseInfoRepository = $app['orm.em']->getRepository('Eccube\Entity\BaseInfo'); |
| 258 | 258 | $BaseInfoRepository->setApplication($app); |
| 259 | 259 | |
| 260 | 260 | return $BaseInfoRepository; |
| 261 | 261 | }; |
| 262 | - $app['eccube.repository.tax_rule'] = function () use ($app) { |
|
| 262 | + $app['eccube.repository.tax_rule'] = function() use ($app) { |
|
| 263 | 263 | $taxRuleRepository = $app['orm.em']->getRepository('Eccube\Entity\TaxRule'); |
| 264 | 264 | $taxRuleRepository->setApplication($app); |
| 265 | 265 | |
| 266 | 266 | return $taxRuleRepository; |
| 267 | 267 | }; |
| 268 | - $app['eccube.repository.page_layout'] = function () use ($app) { |
|
| 268 | + $app['eccube.repository.page_layout'] = function() use ($app) { |
|
| 269 | 269 | $pageLayoutRepository = $app['orm.em']->getRepository('Eccube\Entity\PageLayout'); |
| 270 | 270 | $pageLayoutRepository->setApplication($app); |
| 271 | 271 | |
| 272 | 272 | return $pageLayoutRepository; |
| 273 | 273 | }; |
| 274 | - $app['eccube.repository.block'] = function () use ($app) { |
|
| 274 | + $app['eccube.repository.block'] = function() use ($app) { |
|
| 275 | 275 | $blockRepository = $app['orm.em']->getRepository('Eccube\Entity\Block'); |
| 276 | 276 | $blockRepository->setApplication($app); |
| 277 | 277 | |
| 278 | 278 | return $blockRepository; |
| 279 | 279 | }; |
| 280 | - $app['eccube.repository.order'] = function () use ($app) { |
|
| 280 | + $app['eccube.repository.order'] = function() use ($app) { |
|
| 281 | 281 | $orderRepository = $app['orm.em']->getRepository('Eccube\Entity\Order'); |
| 282 | 282 | $orderRepository->setApplication($app); |
| 283 | 283 | |
| 284 | 284 | return $orderRepository; |
| 285 | 285 | }; |
| 286 | - $app['eccube.repository.customer_address'] = function () use ($app) { |
|
| 286 | + $app['eccube.repository.customer_address'] = function() use ($app) { |
|
| 287 | 287 | return $app['orm.em']->getRepository('Eccube\Entity\CustomerAddress'); |
| 288 | 288 | }; |
| 289 | - $app['eccube.repository.shipping'] = function () use ($app) { |
|
| 289 | + $app['eccube.repository.shipping'] = function() use ($app) { |
|
| 290 | 290 | return $app['orm.em']->getRepository('Eccube\Entity\Shipping'); |
| 291 | 291 | }; |
| 292 | - $app['eccube.repository.shipment_item'] = function () use ($app) { |
|
| 292 | + $app['eccube.repository.shipment_item'] = function() use ($app) { |
|
| 293 | 293 | return $app['orm.em']->getRepository('Eccube\Entity\ShipmentItem'); |
| 294 | 294 | }; |
| 295 | - $app['eccube.repository.customer_status'] = function () use ($app) { |
|
| 295 | + $app['eccube.repository.customer_status'] = function() use ($app) { |
|
| 296 | 296 | return $app['orm.em']->getRepository('Eccube\Entity\Master\CustomerStatus'); |
| 297 | 297 | }; |
| 298 | - $app['eccube.repository.order_status'] = function () use ($app) { |
|
| 298 | + $app['eccube.repository.order_status'] = function() use ($app) { |
|
| 299 | 299 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus'); |
| 300 | 300 | }; |
| 301 | - $app['eccube.repository.mail_template'] = function () use ($app) { |
|
| 301 | + $app['eccube.repository.mail_template'] = function() use ($app) { |
|
| 302 | 302 | return $app['orm.em']->getRepository('Eccube\Entity\MailTemplate'); |
| 303 | 303 | }; |
| 304 | - $app['eccube.repository.csv'] = function () use ($app) { |
|
| 304 | + $app['eccube.repository.csv'] = function() use ($app) { |
|
| 305 | 305 | return $app['orm.em']->getRepository('Eccube\Entity\Csv'); |
| 306 | 306 | }; |
| 307 | - $app['eccube.repository.template'] = function () use ($app) { |
|
| 307 | + $app['eccube.repository.template'] = function() use ($app) { |
|
| 308 | 308 | return $app['orm.em']->getRepository('Eccube\Entity\Template'); |
| 309 | 309 | }; |
| 310 | - $app['eccube.repository.authority_role'] = function () use ($app) { |
|
| 310 | + $app['eccube.repository.authority_role'] = function() use ($app) { |
|
| 311 | 311 | return $app['orm.em']->getRepository('Eccube\Entity\AuthorityRole'); |
| 312 | 312 | }; |
| 313 | 313 | |
| 314 | - $app['paginator'] = $app->protect(function () { |
|
| 314 | + $app['paginator'] = $app->protect(function() { |
|
| 315 | 315 | $paginator = new \Knp\Component\Pager\Paginator(); |
| 316 | 316 | $paginator->subscribe(new \Eccube\EventListener\PaginatorListener()); |
| 317 | 317 | |
| 318 | 318 | return $paginator; |
| 319 | 319 | }); |
| 320 | 320 | |
| 321 | - $app['eccube.repository.help'] = function () use ($app) { |
|
| 321 | + $app['eccube.repository.help'] = function() use ($app) { |
|
| 322 | 322 | return $app['orm.em']->getRepository('Eccube\Entity\Help'); |
| 323 | 323 | }; |
| 324 | - $app['eccube.repository.plugin'] = function () use ($app) { |
|
| 324 | + $app['eccube.repository.plugin'] = function() use ($app) { |
|
| 325 | 325 | return $app['orm.em']->getRepository('Eccube\Entity\Plugin'); |
| 326 | 326 | }; |
| 327 | - $app['eccube.repository.plugin_event_handler'] = function () use ($app) { |
|
| 327 | + $app['eccube.repository.plugin_event_handler'] = function() use ($app) { |
|
| 328 | 328 | return $app['orm.em']->getRepository('Eccube\Entity\PluginEventHandler'); |
| 329 | 329 | }; |
| 330 | - $app['eccube.repository.layout'] = function () use ($app) { |
|
| 330 | + $app['eccube.repository.layout'] = function() use ($app) { |
|
| 331 | 331 | return $app['orm.em']->getRepository('Eccube\Entity\Layout'); |
| 332 | 332 | }; |
| 333 | 333 | |
| 334 | - $app['request_scope'] = function () { |
|
| 334 | + $app['request_scope'] = function() { |
|
| 335 | 335 | return new ParameterBag(); |
| 336 | 336 | }; |
| 337 | 337 | // TODO 使用するか検討 |
| 338 | - $app['eccube.twig.node.hello'] = $app->protect(function ($node, $compiler) { |
|
| 338 | + $app['eccube.twig.node.hello'] = $app->protect(function($node, $compiler) { |
|
| 339 | 339 | $compiler |
| 340 | 340 | ->addDebugInfo($node) |
| 341 | 341 | ->write("echo 'Helloooooo ' . ") |
@@ -345,7 +345,7 @@ discard block |
||
| 345 | 345 | |
| 346 | 346 | }); |
| 347 | 347 | // TODO 使用するか検討 |
| 348 | - $app['eccube.twig.node.jiro'] = $app->protect(function ($node, $compiler) { |
|
| 348 | + $app['eccube.twig.node.jiro'] = $app->protect(function($node, $compiler) { |
|
| 349 | 349 | $compiler |
| 350 | 350 | ->addDebugInfo($node) |
| 351 | 351 | ->write("echo 'jirooooooo ' . ") |
@@ -356,7 +356,7 @@ discard block |
||
| 356 | 356 | }); |
| 357 | 357 | |
| 358 | 358 | // TODO 使用するか検討 |
| 359 | - $app['eccube.twig.generic_node_names'] = function () use ($app) { |
|
| 359 | + $app['eccube.twig.generic_node_names'] = function() use ($app) { |
|
| 360 | 360 | return [ |
| 361 | 361 | 'hello', |
| 362 | 362 | 'jiro', |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | }; |
| 366 | 366 | |
| 367 | 367 | // TODO 使用するか検討 |
| 368 | - $app['twig_parsers'] = function () use ($app) { |
|
| 368 | + $app['twig_parsers'] = function() use ($app) { |
|
| 369 | 369 | $GenericTokenParsers = []; |
| 370 | 370 | foreach ($app['eccube.twig.generic_node_names'] as $tagName) { |
| 371 | 371 | $GenericTokenParsers[] = new \Eccube\Twig\Extension\GenericTokenParser($app, $tagName); |
@@ -374,20 +374,20 @@ discard block |
||
| 374 | 374 | }; |
| 375 | 375 | |
| 376 | 376 | // TODO ServiceProvider から追加できるよう Collection にする |
| 377 | - $app['eccube.twig.block.templates'] = function () { |
|
| 377 | + $app['eccube.twig.block.templates'] = function() { |
|
| 378 | 378 | return [ |
| 379 | 379 | 'render_block.twig', |
| 380 | 380 | ]; |
| 381 | 381 | }; |
| 382 | 382 | |
| 383 | 383 | // Form\Type |
| 384 | - $app->extend('form.type.extensions', function ($extensions) use ($app) { |
|
| 384 | + $app->extend('form.type.extensions', function($extensions) use ($app) { |
|
| 385 | 385 | $extensions[] = new \Eccube\Form\Extension\HelpTypeExtension(); |
| 386 | 386 | $extensions[] = new \Eccube\Form\Extension\FreezeTypeExtension(); |
| 387 | 387 | $extensions[] = new \Eccube\Form\Extension\DoctrineOrmExtension($app['orm.em']); |
| 388 | 388 | return $extensions; |
| 389 | 389 | }); |
| 390 | - $app->extend('form.types', function ($types) use ($app) { |
|
| 390 | + $app->extend('form.types', function($types) use ($app) { |
|
| 391 | 391 | $types[] = new \Eccube\Form\Type\NameType($app['config']); |
| 392 | 392 | $types[] = new \Eccube\Form\Type\KanaType($app['config']); |
| 393 | 393 | $types[] = new \Eccube\Form\Type\TelType($app['config']); |
@@ -491,7 +491,7 @@ discard block |
||
| 491 | 491 | return $types; |
| 492 | 492 | }); |
| 493 | 493 | $app['eccube.entity.event.dispatcher']->addEventListener(new \Acme\Entity\SoldOutEventListener()); |
| 494 | - $app['eccube.queries'] = function () { |
|
| 494 | + $app['eccube.queries'] = function() { |
|
| 495 | 495 | return new \Eccube\Doctrine\Query\Queries(); |
| 496 | 496 | }; |
| 497 | 497 | // TODO QueryCustomizerの追加方法は要検討 |
@@ -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 | } |