@@ -4,7 +4,6 @@ |
||
| 4 | 4 | use Eccube\Entity\Order; |
| 5 | 5 | use Eccube\Entity\PurchaseInterface; |
| 6 | 6 | use Eccube\Entity\ShipmentItem; |
| 7 | -use Eccube\Service\Calculator\Strategy\CalculateStrategyInterface; |
|
| 8 | 7 | |
| 9 | 8 | class CalculateContext |
| 10 | 9 | { |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | $this->buildCalculator($this->CalculateStrategies); |
| 24 | 24 | |
| 25 | 25 | /** @var ShipmentItem $ShipmentItem */ |
| 26 | - foreach($this->ShipmentItems as $ShipmentItem) { |
|
| 26 | + foreach ($this->ShipmentItems as $ShipmentItem) { |
|
| 27 | 27 | if ($ShipmentItem instanceof ShipmentItem) { |
| 28 | 28 | if (!$this->Order->getItems()->contains($ShipmentItem)) { |
| 29 | 29 | $ShipmentItem->setOrder($this->Order); |
@@ -2,13 +2,9 @@ |
||
| 2 | 2 | namespace Eccube\Service\Calculator\Strategy; |
| 3 | 3 | |
| 4 | 4 | use Eccube\Application; |
| 5 | -use Eccube\Entity\Master\OrderItemType; |
|
| 6 | -use Eccube\Entity\Master\TaxType; |
|
| 7 | -use Eccube\Entity\Master\TaxDisplayType; |
|
| 8 | 5 | use Eccube\Entity\Order; |
| 9 | 6 | use Eccube\Entity\PurchaseInterface; |
| 10 | 7 | use Eccube\Entity\ShipmentItem; |
| 11 | -use Eccube\Entity\Shipping; |
|
| 12 | 8 | use Eccube\Repository\Master\OrderItemTypeRepository; |
| 13 | 9 | use Eccube\Service\Calculator\ShipmentItemCollection; |
| 14 | 10 | |
@@ -2,13 +2,9 @@ |
||
| 2 | 2 | namespace Eccube\Service\Calculator\Strategy; |
| 3 | 3 | |
| 4 | 4 | use Eccube\Application; |
| 5 | -use Eccube\Entity\Master\OrderItemType; |
|
| 6 | -use Eccube\Entity\Master\TaxType; |
|
| 7 | -use Eccube\Entity\Master\TaxDisplayType; |
|
| 8 | 5 | use Eccube\Entity\Order; |
| 9 | 6 | use Eccube\Entity\PurchaseInterface; |
| 10 | 7 | use Eccube\Entity\ShipmentItem; |
| 11 | -use Eccube\Entity\Shipping; |
|
| 12 | 8 | use Eccube\Repository\Master\OrderItemTypeRepository; |
| 13 | 9 | use Eccube\Service\Calculator\ShipmentItemCollection; |
| 14 | 10 | |
@@ -2,14 +2,10 @@ |
||
| 2 | 2 | namespace Eccube\Service\Calculator\Strategy; |
| 3 | 3 | |
| 4 | 4 | use Eccube\Application; |
| 5 | -use Eccube\Entity\Master\OrderItemType; |
|
| 6 | -use Eccube\Entity\Master\TaxType; |
|
| 7 | -use Eccube\Entity\Master\TaxDisplayType; |
|
| 8 | 5 | use Eccube\Entity\Cart; |
| 9 | 6 | use Eccube\Entity\Order; |
| 10 | 7 | use Eccube\Entity\PurchaseInterface; |
| 11 | 8 | use Eccube\Entity\ShipmentItem; |
| 12 | -use Eccube\Entity\Shipping; |
|
| 13 | 9 | use Eccube\Repository\Master\OrderItemTypeRepository; |
| 14 | 10 | use Eccube\Service\Calculator\ShipmentItemCollection; |
| 15 | 11 | |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | use Eccube\Entity\Order; |
| 9 | 9 | use Eccube\Entity\PurchaseInterface; |
| 10 | 10 | use Eccube\Entity\ShipmentItem; |
| 11 | -use Eccube\Entity\Shipping; |
|
| 12 | 11 | use Eccube\Repository\Master\OrderItemTypeRepository; |
| 13 | 12 | use Eccube\Service\Calculator\ShipmentItemCollection; |
| 14 | 13 | |
@@ -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); |
@@ -98,47 +98,47 @@ discard block |
||
| 98 | 98 | $Collection->add($app['eccube.calculate.strategy.calculate_total']); |
| 99 | 99 | return $Collection; |
| 100 | 100 | }; |
| 101 | - $app['eccube.calculate.strategy.shipping'] = function () use ($app) { |
|
| 101 | + $app['eccube.calculate.strategy.shipping'] = function() use ($app) { |
|
| 102 | 102 | $Strategy = new \Eccube\Service\Calculator\Strategy\ShippingStrategy(); |
| 103 | 103 | $Strategy->setApplication($app); |
| 104 | 104 | return $Strategy; |
| 105 | 105 | }; |
| 106 | - $app['eccube.calculate.strategy.charge'] = function () use ($app) { |
|
| 106 | + $app['eccube.calculate.strategy.charge'] = function() use ($app) { |
|
| 107 | 107 | $Strategy = new \Eccube\Service\Calculator\Strategy\ChargeStrategy(); |
| 108 | 108 | $Strategy->setApplication($app); |
| 109 | 109 | return $Strategy; |
| 110 | 110 | }; |
| 111 | 111 | |
| 112 | - $app['eccube.calculate.strategy.tax'] = function () use ($app) { |
|
| 112 | + $app['eccube.calculate.strategy.tax'] = function() use ($app) { |
|
| 113 | 113 | $Strategy = new \Eccube\Service\Calculator\Strategy\TaxStrategy(); |
| 114 | 114 | $Strategy->setApplication($app); |
| 115 | 115 | return $Strategy; |
| 116 | 116 | }; |
| 117 | 117 | |
| 118 | - $app['eccube.calculate.strategy.calculate_delivery_fee'] = function () use ($app) { |
|
| 118 | + $app['eccube.calculate.strategy.calculate_delivery_fee'] = function() use ($app) { |
|
| 119 | 119 | $Strategy = new \Eccube\Service\Calculator\Strategy\CalculateDeliveryFeeStrategy(); |
| 120 | 120 | $Strategy->setApplication($app); |
| 121 | 121 | return $Strategy; |
| 122 | 122 | }; |
| 123 | - $app['eccube.calculate.strategy.calculate_charge'] = function () use ($app) { |
|
| 123 | + $app['eccube.calculate.strategy.calculate_charge'] = function() use ($app) { |
|
| 124 | 124 | $Strategy = new \Eccube\Service\Calculator\Strategy\CalculateChargeStrategy(); |
| 125 | 125 | $Strategy->setApplication($app); |
| 126 | 126 | return $Strategy; |
| 127 | 127 | }; |
| 128 | - $app['eccube.calculate.strategy.calculate_total'] = function () use ($app) { |
|
| 128 | + $app['eccube.calculate.strategy.calculate_total'] = function() use ($app) { |
|
| 129 | 129 | $Strategy = new \Eccube\Service\Calculator\Strategy\CalculateTotalStrategy(); |
| 130 | 130 | $Strategy->setApplication($app); |
| 131 | 131 | return $Strategy; |
| 132 | 132 | }; |
| 133 | 133 | |
| 134 | - $app['payment.method'] = $app->protect(function ($clazz, $form) use ($app) { |
|
| 134 | + $app['payment.method'] = $app->protect(function($clazz, $form) use ($app) { |
|
| 135 | 135 | $PaymentMethod = new $clazz; |
| 136 | 136 | $PaymentMethod->setApplication($app); |
| 137 | 137 | $PaymentMethod->setFormType($form); |
| 138 | 138 | return $PaymentMethod; |
| 139 | 139 | }); |
| 140 | 140 | |
| 141 | - $app['payment.method.request'] = $app->protect(function ($clazz, $form, $request) use ($app) { |
|
| 141 | + $app['payment.method.request'] = $app->protect(function($clazz, $form, $request) use ($app) { |
|
| 142 | 142 | $PaymentMethod = new $clazz; |
| 143 | 143 | $PaymentMethod->setApplication($app); |
| 144 | 144 | $PaymentMethod->setFormType($form); |
@@ -146,11 +146,11 @@ discard block |
||
| 146 | 146 | return $PaymentMethod; |
| 147 | 147 | }); |
| 148 | 148 | |
| 149 | - $app['eccube.helper.order'] = function ($app) { |
|
| 149 | + $app['eccube.helper.order'] = function($app) { |
|
| 150 | 150 | return new OrderHelper($app); |
| 151 | 151 | }; |
| 152 | 152 | |
| 153 | - $app['eccube.service.csv.export'] = function () use ($app) { |
|
| 153 | + $app['eccube.service.csv.export'] = function() use ($app) { |
|
| 154 | 154 | $csvService = new \Eccube\Service\CsvExportService(); |
| 155 | 155 | $csvService->setEntityManager($app['orm.em']); |
| 156 | 156 | $csvService->setConfig($app['config']); |
@@ -162,206 +162,206 @@ discard block |
||
| 162 | 162 | |
| 163 | 163 | return $csvService; |
| 164 | 164 | }; |
| 165 | - $app['eccube.service.shopping'] = function () use ($app) { |
|
| 165 | + $app['eccube.service.shopping'] = function() use ($app) { |
|
| 166 | 166 | return new \Eccube\Service\ShoppingService($app, $app['eccube.service.cart'], $app['eccube.service.order']); |
| 167 | 167 | }; |
| 168 | 168 | |
| 169 | 169 | // Repository |
| 170 | - $app['eccube.repository.master.authority'] = function () use ($app) { |
|
| 170 | + $app['eccube.repository.master.authority'] = function() use ($app) { |
|
| 171 | 171 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Authority'); |
| 172 | 172 | }; |
| 173 | - $app['eccube.repository.master.tag'] = function () use ($app) { |
|
| 173 | + $app['eccube.repository.master.tag'] = function() use ($app) { |
|
| 174 | 174 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Tag'); |
| 175 | 175 | }; |
| 176 | - $app['eccube.repository.master.pref'] = function () use ($app) { |
|
| 176 | + $app['eccube.repository.master.pref'] = function() use ($app) { |
|
| 177 | 177 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Pref'); |
| 178 | 178 | }; |
| 179 | - $app['eccube.repository.master.sex'] = function () use ($app) { |
|
| 179 | + $app['eccube.repository.master.sex'] = function() use ($app) { |
|
| 180 | 180 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Sex'); |
| 181 | 181 | }; |
| 182 | - $app['eccube.repository.master.disp'] = function () use ($app) { |
|
| 182 | + $app['eccube.repository.master.disp'] = function() use ($app) { |
|
| 183 | 183 | return $app['orm.em']->getRepository('Eccube\Entity\Master\Disp'); |
| 184 | 184 | }; |
| 185 | - $app['eccube.repository.master.product_type'] = function () use ($app) { |
|
| 185 | + $app['eccube.repository.master.product_type'] = function() use ($app) { |
|
| 186 | 186 | return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductType'); |
| 187 | 187 | }; |
| 188 | - $app['eccube.repository.master.page_max'] = function () use ($app) { |
|
| 188 | + $app['eccube.repository.master.page_max'] = function() use ($app) { |
|
| 189 | 189 | return $app['orm.em']->getRepository('Eccube\Entity\Master\PageMax'); |
| 190 | 190 | }; |
| 191 | - $app['eccube.repository.master.order_status'] = function () use ($app) { |
|
| 191 | + $app['eccube.repository.master.order_status'] = function() use ($app) { |
|
| 192 | 192 | }; |
| 193 | - $app['eccube.repository.master.product_list_max'] = function () use ($app) { |
|
| 193 | + $app['eccube.repository.master.product_list_max'] = function() use ($app) { |
|
| 194 | 194 | return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductListMax'); |
| 195 | 195 | }; |
| 196 | - $app['eccube.repository.master.product_list_order_by'] = function () use ($app) { |
|
| 196 | + $app['eccube.repository.master.product_list_order_by'] = function() use ($app) { |
|
| 197 | 197 | return $app['orm.em']->getRepository('Eccube\Entity\Master\ProductListOrderBy'); |
| 198 | 198 | }; |
| 199 | - $app['eccube.repository.master.order_status'] = function () use ($app) { |
|
| 199 | + $app['eccube.repository.master.order_status'] = function() use ($app) { |
|
| 200 | 200 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus'); |
| 201 | 201 | }; |
| 202 | - $app['eccube.repository.master.device_type'] = function () use ($app) { |
|
| 202 | + $app['eccube.repository.master.device_type'] = function() use ($app) { |
|
| 203 | 203 | return $app['orm.em']->getRepository('Eccube\Entity\Master\DeviceType'); |
| 204 | 204 | }; |
| 205 | - $app['eccube.repository.master.csv_type'] = function () use ($app) { |
|
| 205 | + $app['eccube.repository.master.csv_type'] = function() use ($app) { |
|
| 206 | 206 | return $app['orm.em']->getRepository('Eccube\Entity\Master\CsvType'); |
| 207 | 207 | }; |
| 208 | - $app['eccube.repository.master.order_item_type'] = function () use ($app) { |
|
| 208 | + $app['eccube.repository.master.order_item_type'] = function() use ($app) { |
|
| 209 | 209 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderItemType'); |
| 210 | 210 | }; |
| 211 | 211 | |
| 212 | - $app['eccube.repository.delivery'] = function () use ($app) { |
|
| 212 | + $app['eccube.repository.delivery'] = function() use ($app) { |
|
| 213 | 213 | return $app['orm.em']->getRepository('Eccube\Entity\Delivery'); |
| 214 | 214 | }; |
| 215 | - $app['eccube.repository.delivery_date'] = function () use ($app) { |
|
| 215 | + $app['eccube.repository.delivery_date'] = function() use ($app) { |
|
| 216 | 216 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryDate'); |
| 217 | 217 | }; |
| 218 | - $app['eccube.repository.delivery_fee'] = function () use ($app) { |
|
| 218 | + $app['eccube.repository.delivery_fee'] = function() use ($app) { |
|
| 219 | 219 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryFee'); |
| 220 | 220 | }; |
| 221 | - $app['eccube.repository.delivery_time'] = function () use ($app) { |
|
| 221 | + $app['eccube.repository.delivery_time'] = function() use ($app) { |
|
| 222 | 222 | return $app['orm.em']->getRepository('Eccube\Entity\DeliveryTime'); |
| 223 | 223 | }; |
| 224 | - $app['eccube.repository.payment'] = function () use ($app) { |
|
| 224 | + $app['eccube.repository.payment'] = function() use ($app) { |
|
| 225 | 225 | return $app['orm.em']->getRepository('Eccube\Entity\Payment'); |
| 226 | 226 | }; |
| 227 | - $app['eccube.repository.payment_option'] = function () use ($app) { |
|
| 227 | + $app['eccube.repository.payment_option'] = function() use ($app) { |
|
| 228 | 228 | return $app['orm.em']->getRepository('Eccube\Entity\PaymentOption'); |
| 229 | 229 | }; |
| 230 | - $app['eccube.repository.category'] = function () use ($app) { |
|
| 230 | + $app['eccube.repository.category'] = function() use ($app) { |
|
| 231 | 231 | $CategoryRepository = $app['orm.em']->getRepository('Eccube\Entity\Category'); |
| 232 | 232 | $CategoryRepository->setApplication($app); |
| 233 | 233 | |
| 234 | 234 | return $CategoryRepository; |
| 235 | 235 | }; |
| 236 | - $app['eccube.repository.customer'] = function () use ($app) { |
|
| 236 | + $app['eccube.repository.customer'] = function() use ($app) { |
|
| 237 | 237 | $customerRepository = $app['orm.em']->getRepository('Eccube\Entity\Customer'); |
| 238 | 238 | $customerRepository->setApplication($app); |
| 239 | 239 | return $customerRepository; |
| 240 | 240 | }; |
| 241 | - $app['eccube.repository.news'] = function () use ($app) { |
|
| 241 | + $app['eccube.repository.news'] = function() use ($app) { |
|
| 242 | 242 | return $app['orm.em']->getRepository('Eccube\Entity\News'); |
| 243 | 243 | }; |
| 244 | - $app['eccube.repository.mail_history'] = function () use ($app) { |
|
| 244 | + $app['eccube.repository.mail_history'] = function() use ($app) { |
|
| 245 | 245 | return $app['orm.em']->getRepository('Eccube\Entity\MailHistory'); |
| 246 | 246 | }; |
| 247 | - $app['eccube.repository.member'] = function () use ($app) { |
|
| 247 | + $app['eccube.repository.member'] = function() use ($app) { |
|
| 248 | 248 | $memberRepository = $app['orm.em']->getRepository('Eccube\Entity\Member'); |
| 249 | 249 | $memberRepository->setEncoderFactorty($app['security.encoder_factory']); |
| 250 | 250 | return $memberRepository; |
| 251 | 251 | }; |
| 252 | - $app['eccube.repository.order'] = function () use ($app) { |
|
| 252 | + $app['eccube.repository.order'] = function() use ($app) { |
|
| 253 | 253 | return $app['orm.em']->getRepository('Eccube\Entity\Order'); |
| 254 | 254 | }; |
| 255 | - $app['eccube.repository.product'] = function () use ($app) { |
|
| 255 | + $app['eccube.repository.product'] = function() use ($app) { |
|
| 256 | 256 | $productRepository = $app['orm.em']->getRepository('Eccube\Entity\Product'); |
| 257 | 257 | $productRepository->setApplication($app); |
| 258 | 258 | |
| 259 | 259 | return $productRepository; |
| 260 | 260 | }; |
| 261 | - $app['eccube.repository.product_image'] = function () use ($app) { |
|
| 261 | + $app['eccube.repository.product_image'] = function() use ($app) { |
|
| 262 | 262 | return $app['orm.em']->getRepository('Eccube\Entity\ProductImage'); |
| 263 | 263 | }; |
| 264 | - $app['eccube.repository.product_class'] = function () use ($app) { |
|
| 264 | + $app['eccube.repository.product_class'] = function() use ($app) { |
|
| 265 | 265 | return $app['orm.em']->getRepository('Eccube\Entity\ProductClass'); |
| 266 | 266 | }; |
| 267 | - $app['eccube.repository.product_stock'] = function () use ($app) { |
|
| 267 | + $app['eccube.repository.product_stock'] = function() use ($app) { |
|
| 268 | 268 | return $app['orm.em']->getRepository('Eccube\Entity\ProductStock'); |
| 269 | 269 | }; |
| 270 | - $app['eccube.repository.product_tag'] = function () use ($app) { |
|
| 270 | + $app['eccube.repository.product_tag'] = function() use ($app) { |
|
| 271 | 271 | return $app['orm.em']->getRepository('Eccube\Entity\ProductTag'); |
| 272 | 272 | }; |
| 273 | - $app['eccube.repository.class_name'] = function () use ($app) { |
|
| 273 | + $app['eccube.repository.class_name'] = function() use ($app) { |
|
| 274 | 274 | return $app['orm.em']->getRepository('Eccube\Entity\ClassName'); |
| 275 | 275 | }; |
| 276 | - $app['eccube.repository.class_category'] = function () use ($app) { |
|
| 276 | + $app['eccube.repository.class_category'] = function() use ($app) { |
|
| 277 | 277 | return $app['orm.em']->getRepository('Eccube\Entity\ClassCategory'); |
| 278 | 278 | }; |
| 279 | - $app['eccube.repository.customer_favorite_product'] = function () use ($app) { |
|
| 279 | + $app['eccube.repository.customer_favorite_product'] = function() use ($app) { |
|
| 280 | 280 | return $app['orm.em']->getRepository('Eccube\Entity\CustomerFavoriteProduct'); |
| 281 | 281 | }; |
| 282 | - $app['eccube.repository.base_info'] = function () use ($app) { |
|
| 282 | + $app['eccube.repository.base_info'] = function() use ($app) { |
|
| 283 | 283 | $BaseInfoRepository = $app['orm.em']->getRepository('Eccube\Entity\BaseInfo'); |
| 284 | 284 | $BaseInfoRepository->setApplication($app); |
| 285 | 285 | |
| 286 | 286 | return $BaseInfoRepository; |
| 287 | 287 | }; |
| 288 | - $app['eccube.repository.tax_rule'] = function () use ($app) { |
|
| 288 | + $app['eccube.repository.tax_rule'] = function() use ($app) { |
|
| 289 | 289 | $taxRuleRepository = $app['orm.em']->getRepository('Eccube\Entity\TaxRule'); |
| 290 | 290 | $taxRuleRepository->setApplication($app); |
| 291 | 291 | |
| 292 | 292 | return $taxRuleRepository; |
| 293 | 293 | }; |
| 294 | - $app['eccube.repository.page_layout'] = function () use ($app) { |
|
| 294 | + $app['eccube.repository.page_layout'] = function() use ($app) { |
|
| 295 | 295 | $pageLayoutRepository = $app['orm.em']->getRepository('Eccube\Entity\PageLayout'); |
| 296 | 296 | $pageLayoutRepository->setApplication($app); |
| 297 | 297 | |
| 298 | 298 | return $pageLayoutRepository; |
| 299 | 299 | }; |
| 300 | - $app['eccube.repository.block'] = function () use ($app) { |
|
| 300 | + $app['eccube.repository.block'] = function() use ($app) { |
|
| 301 | 301 | $blockRepository = $app['orm.em']->getRepository('Eccube\Entity\Block'); |
| 302 | 302 | $blockRepository->setApplication($app); |
| 303 | 303 | |
| 304 | 304 | return $blockRepository; |
| 305 | 305 | }; |
| 306 | - $app['eccube.repository.order'] = function () use ($app) { |
|
| 306 | + $app['eccube.repository.order'] = function() use ($app) { |
|
| 307 | 307 | $orderRepository = $app['orm.em']->getRepository('Eccube\Entity\Order'); |
| 308 | 308 | $orderRepository->setApplication($app); |
| 309 | 309 | |
| 310 | 310 | return $orderRepository; |
| 311 | 311 | }; |
| 312 | - $app['eccube.repository.customer_address'] = function () use ($app) { |
|
| 312 | + $app['eccube.repository.customer_address'] = function() use ($app) { |
|
| 313 | 313 | return $app['orm.em']->getRepository('Eccube\Entity\CustomerAddress'); |
| 314 | 314 | }; |
| 315 | - $app['eccube.repository.shipping'] = function () use ($app) { |
|
| 315 | + $app['eccube.repository.shipping'] = function() use ($app) { |
|
| 316 | 316 | return $app['orm.em']->getRepository('Eccube\Entity\Shipping'); |
| 317 | 317 | }; |
| 318 | - $app['eccube.repository.shipment_item'] = function () use ($app) { |
|
| 318 | + $app['eccube.repository.shipment_item'] = function() use ($app) { |
|
| 319 | 319 | return $app['orm.em']->getRepository('Eccube\Entity\ShipmentItem'); |
| 320 | 320 | }; |
| 321 | - $app['eccube.repository.customer_status'] = function () use ($app) { |
|
| 321 | + $app['eccube.repository.customer_status'] = function() use ($app) { |
|
| 322 | 322 | return $app['orm.em']->getRepository('Eccube\Entity\Master\CustomerStatus'); |
| 323 | 323 | }; |
| 324 | - $app['eccube.repository.order_status'] = function () use ($app) { |
|
| 324 | + $app['eccube.repository.order_status'] = function() use ($app) { |
|
| 325 | 325 | return $app['orm.em']->getRepository('Eccube\Entity\Master\OrderStatus'); |
| 326 | 326 | }; |
| 327 | - $app['eccube.repository.mail_template'] = function () use ($app) { |
|
| 327 | + $app['eccube.repository.mail_template'] = function() use ($app) { |
|
| 328 | 328 | return $app['orm.em']->getRepository('Eccube\Entity\MailTemplate'); |
| 329 | 329 | }; |
| 330 | - $app['eccube.repository.csv'] = function () use ($app) { |
|
| 330 | + $app['eccube.repository.csv'] = function() use ($app) { |
|
| 331 | 331 | return $app['orm.em']->getRepository('Eccube\Entity\Csv'); |
| 332 | 332 | }; |
| 333 | - $app['eccube.repository.template'] = function () use ($app) { |
|
| 333 | + $app['eccube.repository.template'] = function() use ($app) { |
|
| 334 | 334 | return $app['orm.em']->getRepository('Eccube\Entity\Template'); |
| 335 | 335 | }; |
| 336 | - $app['eccube.repository.authority_role'] = function () use ($app) { |
|
| 336 | + $app['eccube.repository.authority_role'] = function() use ($app) { |
|
| 337 | 337 | return $app['orm.em']->getRepository('Eccube\Entity\AuthorityRole'); |
| 338 | 338 | }; |
| 339 | 339 | |
| 340 | - $app['paginator'] = $app->protect(function () { |
|
| 340 | + $app['paginator'] = $app->protect(function() { |
|
| 341 | 341 | $paginator = new \Knp\Component\Pager\Paginator(); |
| 342 | 342 | $paginator->subscribe(new \Eccube\EventListener\PaginatorListener()); |
| 343 | 343 | |
| 344 | 344 | return $paginator; |
| 345 | 345 | }); |
| 346 | 346 | |
| 347 | - $app['eccube.repository.help'] = function () use ($app) { |
|
| 347 | + $app['eccube.repository.help'] = function() use ($app) { |
|
| 348 | 348 | return $app['orm.em']->getRepository('Eccube\Entity\Help'); |
| 349 | 349 | }; |
| 350 | - $app['eccube.repository.plugin'] = function () use ($app) { |
|
| 350 | + $app['eccube.repository.plugin'] = function() use ($app) { |
|
| 351 | 351 | return $app['orm.em']->getRepository('Eccube\Entity\Plugin'); |
| 352 | 352 | }; |
| 353 | - $app['eccube.repository.plugin_event_handler'] = function () use ($app) { |
|
| 353 | + $app['eccube.repository.plugin_event_handler'] = function() use ($app) { |
|
| 354 | 354 | return $app['orm.em']->getRepository('Eccube\Entity\PluginEventHandler'); |
| 355 | 355 | }; |
| 356 | - $app['eccube.repository.layout'] = function () use ($app) { |
|
| 356 | + $app['eccube.repository.layout'] = function() use ($app) { |
|
| 357 | 357 | return $app['orm.em']->getRepository('Eccube\Entity\Layout'); |
| 358 | 358 | }; |
| 359 | 359 | |
| 360 | - $app['request_scope'] = function () { |
|
| 360 | + $app['request_scope'] = function() { |
|
| 361 | 361 | return new ParameterBag(); |
| 362 | 362 | }; |
| 363 | 363 | // TODO 使用するか検討 |
| 364 | - $app['eccube.twig.node.hello'] = $app->protect(function ($node, $compiler) { |
|
| 364 | + $app['eccube.twig.node.hello'] = $app->protect(function($node, $compiler) { |
|
| 365 | 365 | $compiler |
| 366 | 366 | ->addDebugInfo($node) |
| 367 | 367 | ->write("echo 'Helloooooo ' . ") |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | |
| 372 | 372 | }); |
| 373 | 373 | // TODO 使用するか検討 |
| 374 | - $app['eccube.twig.node.jiro'] = $app->protect(function ($node, $compiler) { |
|
| 374 | + $app['eccube.twig.node.jiro'] = $app->protect(function($node, $compiler) { |
|
| 375 | 375 | $compiler |
| 376 | 376 | ->addDebugInfo($node) |
| 377 | 377 | ->write("echo 'jirooooooo ' . ") |
@@ -382,7 +382,7 @@ discard block |
||
| 382 | 382 | }); |
| 383 | 383 | |
| 384 | 384 | // TODO 使用するか検討 |
| 385 | - $app['eccube.twig.generic_node_names'] = function () use ($app) { |
|
| 385 | + $app['eccube.twig.generic_node_names'] = function() use ($app) { |
|
| 386 | 386 | return [ |
| 387 | 387 | 'hello', |
| 388 | 388 | 'jiro', |
@@ -391,7 +391,7 @@ discard block |
||
| 391 | 391 | }; |
| 392 | 392 | |
| 393 | 393 | // TODO 使用するか検討 |
| 394 | - $app['twig_parsers'] = function () use ($app) { |
|
| 394 | + $app['twig_parsers'] = function() use ($app) { |
|
| 395 | 395 | $GenericTokenParsers = []; |
| 396 | 396 | foreach ($app['eccube.twig.generic_node_names'] as $tagName) { |
| 397 | 397 | $GenericTokenParsers[] = new \Eccube\Twig\Extension\GenericTokenParser($app, $tagName); |
@@ -400,20 +400,20 @@ discard block |
||
| 400 | 400 | }; |
| 401 | 401 | |
| 402 | 402 | // TODO ServiceProvider から追加できるよう Collection にする |
| 403 | - $app['eccube.twig.block.templates'] = function () { |
|
| 403 | + $app['eccube.twig.block.templates'] = function() { |
|
| 404 | 404 | return [ |
| 405 | 405 | 'render_block.twig', |
| 406 | 406 | ]; |
| 407 | 407 | }; |
| 408 | 408 | |
| 409 | 409 | // Form\Type |
| 410 | - $app->extend('form.type.extensions', function ($extensions) use ($app) { |
|
| 410 | + $app->extend('form.type.extensions', function($extensions) use ($app) { |
|
| 411 | 411 | $extensions[] = new \Eccube\Form\Extension\HelpTypeExtension(); |
| 412 | 412 | $extensions[] = new \Eccube\Form\Extension\FreezeTypeExtension(); |
| 413 | 413 | $extensions[] = new \Eccube\Form\Extension\DoctrineOrmExtension($app['orm.em']); |
| 414 | 414 | return $extensions; |
| 415 | 415 | }); |
| 416 | - $app->extend('form.types', function ($types) use ($app) { |
|
| 416 | + $app->extend('form.types', function($types) use ($app) { |
|
| 417 | 417 | $types[] = new \Eccube\Form\Type\NameType($app['config']); |
| 418 | 418 | $types[] = new \Eccube\Form\Type\KanaType($app['config']); |
| 419 | 419 | $types[] = new \Eccube\Form\Type\TelType($app['config']); |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | return $types; |
| 518 | 518 | }); |
| 519 | 519 | $app['eccube.entity.event.dispatcher']->addEventListener(new \Acme\Entity\SoldOutEventListener()); |
| 520 | - $app['eccube.queries'] = function () { |
|
| 520 | + $app['eccube.queries'] = function() { |
|
| 521 | 521 | return new \Eccube\Doctrine\Query\Queries(); |
| 522 | 522 | }; |
| 523 | 523 | // TODO QueryCustomizerの追加方法は要検討 |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | public function hasProductByName($productName) |
| 64 | 64 | { |
| 65 | 65 | $ShipmentItems = $this->filter( |
| 66 | - function (ItemInterface $ShipmentItem) use ($productName) { |
|
| 66 | + function(ItemInterface $ShipmentItem) use ($productName) { |
|
| 67 | 67 | /* @var ShipmentItem $ShipmentItem */ |
| 68 | 68 | return $ShipmentItem->getProductName() == $productName; |
| 69 | 69 | }); |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | /** |
| 258 | 258 | * 複数配送オプション有効時の画面制御を行う. |
| 259 | 259 | */ |
| 260 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) use ($BaseInfo) { |
|
| 260 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) use ($BaseInfo) { |
|
| 261 | 261 | |
| 262 | 262 | if ($BaseInfo->getOptionMultipleShipping() != Constant::ENABLED) { |
| 263 | 263 | return; |
@@ -267,17 +267,16 @@ discard block |
||
| 267 | 267 | $orderDetails = &$data['OrderDetails']; |
| 268 | 268 | |
| 269 | 269 | // 数量0フィルター |
| 270 | - $quantityFilter = function ($v) { |
|
| 270 | + $quantityFilter = function($v) { |
|
| 271 | 271 | return !(isset($v['quantity']) && preg_match('/^0+$/', trim($v['quantity']))); |
| 272 | 272 | }; |
| 273 | 273 | |
| 274 | 274 | // $shippings = &$data['Shippings']; |
| 275 | 275 | |
| 276 | 276 | // 数量を抽出 |
| 277 | - $getQuantity = function ($v) { |
|
| 277 | + $getQuantity = function($v) { |
|
| 278 | 278 | return (isset($v['quantity']) && preg_match('/^\d+$/', trim($v['quantity']))) ? |
| 279 | - trim($v['quantity']) : |
|
| 280 | - 0; |
|
| 279 | + trim($v['quantity']) : 0; |
|
| 281 | 280 | }; |
| 282 | 281 | |
| 283 | 282 | // foreach ($shippings as &$shipping) { |
@@ -294,7 +293,7 @@ discard block |
||
| 294 | 293 | $orderDetail['quantity'] = 0; |
| 295 | 294 | |
| 296 | 295 | // 受注詳細と同じ商品規格のみ抽出 |
| 297 | - $productClassFilter = function ($v) use ($orderDetail) { |
|
| 296 | + $productClassFilter = function($v) use ($orderDetail) { |
|
| 298 | 297 | return $orderDetail['ProductClass'] === $v['ProductClass']; |
| 299 | 298 | }; |
| 300 | 299 | |
@@ -303,10 +302,9 @@ discard block |
||
| 303 | 302 | if (!empty($shipping['ShipmentItems'])) { |
| 304 | 303 | |
| 305 | 304 | // 同じ商品規格の受注詳細の価格を適用 |
| 306 | - $applyPrice = function (&$v) use ($orderDetail) { |
|
| 305 | + $applyPrice = function(&$v) use ($orderDetail) { |
|
| 307 | 306 | $v['price'] = ($v['ProductClass'] === $orderDetail['ProductClass']) ? |
| 308 | - $orderDetail['price'] : |
|
| 309 | - $v['price']; |
|
| 307 | + $orderDetail['price'] : $v['price']; |
|
| 310 | 308 | }; |
| 311 | 309 | array_walk($shipping['ShipmentItems'], $applyPrice); |
| 312 | 310 | |
@@ -335,7 +333,7 @@ discard block |
||
| 335 | 333 | // } |
| 336 | 334 | // }); |
| 337 | 335 | // 選択された支払い方法の名称をエンティティにコピーする |
| 338 | - $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { |
|
| 336 | + $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) { |
|
| 339 | 337 | $Order = $event->getData(); |
| 340 | 338 | $Payment = $Order->getPayment(); |
| 341 | 339 | if (!is_null($Payment)) { |
@@ -343,7 +341,7 @@ discard block |
||
| 343 | 341 | } |
| 344 | 342 | }); |
| 345 | 343 | // TODO 手数料, 値引きの集計は CalculateService で |
| 346 | - $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { |
|
| 344 | + $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) { |
|
| 347 | 345 | $Order = $event->getData(); |
| 348 | 346 | $Order->setDiscount($Order->calculateDiscountTotal()); |
| 349 | 347 | // $Order->setCharge($Order->calculateChargeTotal()); |
@@ -351,7 +349,7 @@ discard block |
||
| 351 | 349 | $event->setData($Order); |
| 352 | 350 | }); |
| 353 | 351 | // 会員受注の場合、会員の性別/職業/誕生日をエンティティにコピーする |
| 354 | - $builder->addEventListener(FormEvents::POST_SUBMIT, function (FormEvent $event) { |
|
| 352 | + $builder->addEventListener(FormEvents::POST_SUBMIT, function(FormEvent $event) { |
|
| 355 | 353 | $Order = $event->getData(); |
| 356 | 354 | $Customer = $Order->getCustomer(); |
| 357 | 355 | if (!is_null($Customer)) { |