@@ -38,14 +38,14 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 40 | 40 | { |
| 41 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
| 41 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
| 42 | 42 | $options = $event->getForm()->getConfig()->getOptions(); |
| 43 | 43 | if (!$event->getData()) { |
| 44 | 44 | $data = current(array_keys($options['choice_loader']->loadChoiceList()->getValues())); |
| 45 | 45 | $event->setData($data); |
| 46 | 46 | } |
| 47 | 47 | }); |
| 48 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { |
|
| 48 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) { |
|
| 49 | 49 | $options = $event->getForm()->getConfig()->getOptions(); |
| 50 | 50 | $values = $options['choice_loader']->loadChoiceList()->getValues(); |
| 51 | 51 | if (!in_array($event->getData(), $values)) { |
@@ -38,14 +38,14 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 40 | 40 | { |
| 41 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
| 41 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
| 42 | 42 | $options = $event->getForm()->getConfig()->getOptions(); |
| 43 | 43 | if (!$event->getData()) { |
| 44 | 44 | $data = current(array_keys($options['choice_loader']->loadChoiceList()->getValues())); |
| 45 | 45 | $event->setData($data); |
| 46 | 46 | } |
| 47 | 47 | }); |
| 48 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { |
|
| 48 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) { |
|
| 49 | 49 | $options = $event->getForm()->getConfig()->getOptions(); |
| 50 | 50 | $values = $options['choice_loader']->loadChoiceList()->getValues(); |
| 51 | 51 | if (!in_array($event->getData(), $values)) { |
@@ -42,7 +42,7 @@ |
||
| 42 | 42 | 'expanded' => false, |
| 43 | 43 | 'required' => false, |
| 44 | 44 | 'placeholder' => false, |
| 45 | - 'query_builder' => function (EntityRepository $er) { |
|
| 45 | + 'query_builder' => function(EntityRepository $er) { |
|
| 46 | 46 | return $er->createQueryBuilder('m') |
| 47 | 47 | ->orderBy('m.rank', 'ASC'); |
| 48 | 48 | }, |
@@ -38,14 +38,14 @@ |
||
| 38 | 38 | */ |
| 39 | 39 | public function buildForm(FormBuilderInterface $builder, array $options) |
| 40 | 40 | { |
| 41 | - $builder->addEventListener(FormEvents::PRE_SET_DATA, function (FormEvent $event) { |
|
| 41 | + $builder->addEventListener(FormEvents::PRE_SET_DATA, function(FormEvent $event) { |
|
| 42 | 42 | $options = $event->getForm()->getConfig()->getOptions(); |
| 43 | 43 | if (!$event->getData()) { |
| 44 | 44 | $data = current(array_keys($options['choice_loader']->loadChoiceList()->getValues())); |
| 45 | 45 | $event->setData($data); |
| 46 | 46 | } |
| 47 | 47 | }); |
| 48 | - $builder->addEventListener(FormEvents::PRE_SUBMIT, function (FormEvent $event) { |
|
| 48 | + $builder->addEventListener(FormEvents::PRE_SUBMIT, function(FormEvent $event) { |
|
| 49 | 49 | $options = $event->getForm()->getConfig()->getOptions(); |
| 50 | 50 | $values = $options['choice_loader']->loadChoiceList()->getValues(); |
| 51 | 51 | if (!in_array($event->getData(), $values)) { |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | |
| 15 | 15 | public function setRequireHttps($requireHttps) |
| 16 | 16 | { |
| 17 | - $this->requireHttps = (bool)$requireHttps; |
|
| 17 | + $this->requireHttps = (bool) $requireHttps; |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | public function setAdminPrefix($adminPrefix) |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | $extension = $image->getClientOriginalExtension(); |
| 206 | - $filename = date('mdHis') . uniqid('_') . '.' . $extension; |
|
| 206 | + $filename = date('mdHis').uniqid('_').'.'.$extension; |
|
| 207 | 207 | $image->move($app['config']['image_temp_realdir'], $filename); |
| 208 | 208 | $files[] = $filename; |
| 209 | 209 | } |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | $form = $builder->getForm(); |
| 280 | 280 | |
| 281 | 281 | if (!$has_class) { |
| 282 | - $ProductClass->setStockUnlimited((boolean)$ProductClass->getStockUnlimited()); |
|
| 282 | + $ProductClass->setStockUnlimited((boolean) $ProductClass->getStockUnlimited()); |
|
| 283 | 283 | $form['class']->setData($ProductClass); |
| 284 | 284 | } |
| 285 | 285 | |
@@ -365,8 +365,8 @@ discard block |
||
| 365 | 365 | $Categories = $form->get('Category')->getData(); |
| 366 | 366 | $categoriesIdList = array(); |
| 367 | 367 | foreach ($Categories as $Category) { |
| 368 | - foreach($Category->getPath() as $ParentCategory){ |
|
| 369 | - if (!isset($categoriesIdList[$ParentCategory->getId()])){ |
|
| 368 | + foreach ($Category->getPath() as $ParentCategory) { |
|
| 369 | + if (!isset($categoriesIdList[$ParentCategory->getId()])) { |
|
| 370 | 370 | $ProductCategory = $this->createProductCategory($Product, $ParentCategory, $count); |
| 371 | 371 | $app['orm.em']->persist($ProductCategory); |
| 372 | 372 | $count++; |
@@ -375,7 +375,7 @@ discard block |
||
| 375 | 375 | $categoriesIdList[$ParentCategory->getId()] = true; |
| 376 | 376 | } |
| 377 | 377 | } |
| 378 | - if (!isset($categoriesIdList[$Category->getId()])){ |
|
| 378 | + if (!isset($categoriesIdList[$Category->getId()])) { |
|
| 379 | 379 | $ProductCategory = $this->createProductCategory($Product, $Category, $count); |
| 380 | 380 | $app['orm.em']->persist($ProductCategory); |
| 381 | 381 | $count++; |
@@ -397,7 +397,7 @@ discard block |
||
| 397 | 397 | $app['orm.em']->persist($ProductImage); |
| 398 | 398 | |
| 399 | 399 | // 移動 |
| 400 | - $file = new File($app['config']['image_temp_realdir'] . '/' . $add_image); |
|
| 400 | + $file = new File($app['config']['image_temp_realdir'].'/'.$add_image); |
|
| 401 | 401 | $file->move($app['config']['image_save_realdir']); |
| 402 | 402 | } |
| 403 | 403 | |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | |
| 418 | 418 | // 削除 |
| 419 | 419 | $fs = new Filesystem(); |
| 420 | - $fs->remove($app['config']['image_save_realdir'] . '/' . $delete_image); |
|
| 420 | + $fs->remove($app['config']['image_save_realdir'].'/'.$delete_image); |
|
| 421 | 421 | } |
| 422 | 422 | $app['orm.em']->persist($Product); |
| 423 | 423 | $app['orm.em']->flush(); |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | foreach ($deleteImages as $deleteImage) { |
| 578 | 578 | try { |
| 579 | 579 | $fs = new Filesystem(); |
| 580 | - $fs->remove($app['config']['image_save_realdir'] . '/' . $deleteImage); |
|
| 580 | + $fs->remove($app['config']['image_save_realdir'].'/'.$deleteImage); |
|
| 581 | 581 | } catch (\Exception $e) { |
| 582 | 582 | // エラーが発生しても無視する |
| 583 | 583 | } |
@@ -647,10 +647,10 @@ discard block |
||
| 647 | 647 | |
| 648 | 648 | // 画像ファイルを新規作成 |
| 649 | 649 | $extension = pathinfo($Image->getFileName(), PATHINFO_EXTENSION); |
| 650 | - $filename = date('mdHis') . uniqid('_') . '.' . $extension; |
|
| 650 | + $filename = date('mdHis').uniqid('_').'.'.$extension; |
|
| 651 | 651 | try { |
| 652 | 652 | $fs = new Filesystem(); |
| 653 | - $fs->copy($app['config']['image_save_realdir'] . '/' . $Image->getFileName(), $app['config']['image_save_realdir'] . '/' . $filename); |
|
| 653 | + $fs->copy($app['config']['image_save_realdir'].'/'.$Image->getFileName(), $app['config']['image_save_realdir'].'/'.$filename); |
|
| 654 | 654 | } catch (\Exception $e) { |
| 655 | 655 | // エラーが発生しても無視する |
| 656 | 656 | } |
@@ -725,7 +725,7 @@ discard block |
||
| 725 | 725 | $em->getConfiguration()->setSQLLogger(null); |
| 726 | 726 | |
| 727 | 727 | $response = new StreamedResponse(); |
| 728 | - $response->setCallback(function () use ($app, $request) { |
|
| 728 | + $response->setCallback(function() use ($app, $request) { |
|
| 729 | 729 | |
| 730 | 730 | // CSV種別を元に初期化. |
| 731 | 731 | $app['eccube.service.csv.export']->initCsvType(CsvType::CSV_TYPE_PRODUCT); |
@@ -765,7 +765,7 @@ discard block |
||
| 765 | 765 | // データ行の出力. |
| 766 | 766 | $app['eccube.service.csv.export']->setExportQueryBuilder($qb); |
| 767 | 767 | |
| 768 | - $app['eccube.service.csv.export']->exportData(function ($entity, CsvExportService $csvService) use ($app, $request) { |
|
| 768 | + $app['eccube.service.csv.export']->exportData(function($entity, CsvExportService $csvService) use ($app, $request) { |
|
| 769 | 769 | $Csvs = $csvService->getCsvs(); |
| 770 | 770 | |
| 771 | 771 | /** @var $Product \Eccube\Entity\Product */ |
@@ -808,9 +808,9 @@ discard block |
||
| 808 | 808 | }); |
| 809 | 809 | |
| 810 | 810 | $now = new \DateTime(); |
| 811 | - $filename = 'product_' . $now->format('YmdHis') . '.csv'; |
|
| 811 | + $filename = 'product_'.$now->format('YmdHis').'.csv'; |
|
| 812 | 812 | $response->headers->set('Content-Type', 'application/octet-stream'); |
| 813 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
| 813 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
| 814 | 814 | $response->send(); |
| 815 | 815 | |
| 816 | 816 | log_info('商品CSV出力ファイル名', array($filename)); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | public function register(Container $app) |
| 74 | 74 | { |
| 75 | - $app['var_dumper.cloner'] = function ($app) { |
|
| 75 | + $app['var_dumper.cloner'] = function($app) { |
|
| 76 | 76 | $cloner = new VarCloner(); |
| 77 | 77 | |
| 78 | 78 | if (isset($app['debug.max_items'])) { |
@@ -86,37 +86,37 @@ discard block |
||
| 86 | 86 | return $cloner; |
| 87 | 87 | }; |
| 88 | 88 | |
| 89 | - $app->extend('data_collector.templates', function ($templates) { |
|
| 89 | + $app->extend('data_collector.templates', function($templates) { |
|
| 90 | 90 | return array_merge($templates, array(array('dump', '@Debug/Profiler/dump.html.twig'))); |
| 91 | 91 | }); |
| 92 | 92 | |
| 93 | - $app['data_collector.dump'] = function ($app) { |
|
| 93 | + $app['data_collector.dump'] = function($app) { |
|
| 94 | 94 | return new DumpDataCollector($app['stopwatch'], $app['code.file_link_format'], null, null, new HtmlDumper()); |
| 95 | 95 | }; |
| 96 | 96 | |
| 97 | - $app->extend('data_collectors', function ($collectors, $app) { |
|
| 98 | - $collectors['dump'] = function ($app) { |
|
| 97 | + $app->extend('data_collectors', function($collectors, $app) { |
|
| 98 | + $collectors['dump'] = function($app) { |
|
| 99 | 99 | return $app['data_collector.dump']; |
| 100 | 100 | }; |
| 101 | 101 | |
| 102 | - $collectors['eccube'] = function ($app) { |
|
| 102 | + $collectors['eccube'] = function($app) { |
|
| 103 | 103 | return new EccubeDataCollector($app); |
| 104 | 104 | }; |
| 105 | 105 | return $collectors; |
| 106 | 106 | }); |
| 107 | 107 | |
| 108 | - $app->extend('data_collector.templates', function ($templates, $app) { |
|
| 108 | + $app->extend('data_collector.templates', function($templates, $app) { |
|
| 109 | 109 | array_unshift($templates, ['eccube', '@EccubeProfiler/eccube.html.twig']); |
| 110 | 110 | return $templates; |
| 111 | 111 | } |
| 112 | 112 | ); |
| 113 | 113 | |
| 114 | - $app->extend('twig.loader.filesystem', function ($filesystem, $app) { |
|
| 114 | + $app->extend('twig.loader.filesystem', function($filesystem, $app) { |
|
| 115 | 115 | return $filesystem; |
| 116 | 116 | } |
| 117 | 117 | ); |
| 118 | 118 | |
| 119 | - $app->extend('twig', function ($twig, $app) { |
|
| 119 | + $app->extend('twig', function($twig, $app) { |
|
| 120 | 120 | if (class_exists('\Symfony\Bridge\Twig\Extension\DumpExtension')) { |
| 121 | 121 | $twig->addExtension(new DumpExtension($app['var_dumper.cloner'])); |
| 122 | 122 | } |
@@ -124,14 +124,14 @@ discard block |
||
| 124 | 124 | return $twig; |
| 125 | 125 | }); |
| 126 | 126 | |
| 127 | - $app->extend('twig.loader.filesystem', function ($loader, $app) { |
|
| 127 | + $app->extend('twig.loader.filesystem', function($loader, $app) { |
|
| 128 | 128 | $loader->addPath($app['debug.templates_path'], 'Debug'); |
| 129 | 129 | $loader->addPath(__DIR__.'/../Resource/template/toolbar', 'EccubeProfiler'); |
| 130 | 130 | |
| 131 | 131 | return $loader; |
| 132 | 132 | }); |
| 133 | 133 | |
| 134 | - $app['debug.templates_path'] = function () { |
|
| 134 | + $app['debug.templates_path'] = function() { |
|
| 135 | 135 | $r = new \ReflectionClass('Symfony\Bundle\DebugBundle\DependencyInjection\Configuration'); |
| 136 | 136 | |
| 137 | 137 | return dirname(dirname($r->getFileName())).'/Resources/views'; |
@@ -143,11 +143,11 @@ discard block |
||
| 143 | 143 | // This code is here to lazy load the dump stack. This default |
| 144 | 144 | // configuration for CLI mode is overridden in HTTP mode on |
| 145 | 145 | // 'kernel.request' event |
| 146 | - VarDumper::setHandler(function ($var) use ($app) { |
|
| 146 | + VarDumper::setHandler(function($var) use ($app) { |
|
| 147 | 147 | $dumper = $app['data_collector.dump']; |
| 148 | 148 | $cloner = $app['var_dumper.cloner']; |
| 149 | 149 | |
| 150 | - $handler = function ($var) use ($dumper, $cloner) { |
|
| 150 | + $handler = function($var) use ($dumper, $cloner) { |
|
| 151 | 151 | $dumper->dump($cloner->cloneVar($var)); |
| 152 | 152 | }; |
| 153 | 153 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | { |
| 19 | 19 | return new self(array_filter( |
| 20 | 20 | $this->getArrayCopy(), |
| 21 | - function ($OrderDetail) { |
|
| 21 | + function($OrderDetail) { |
|
| 22 | 22 | if ($OrderDetail->getProductClass()) { |
| 23 | 23 | return true; |
| 24 | 24 | } |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | public function hasProductByName($productName) |
| 36 | 36 | { |
| 37 | 37 | $OrderDetails = array_filter($this->getArrayCopy(), |
| 38 | - function ($OrderDetail) use ($productName) { |
|
| 38 | + function($OrderDetail) use ($productName) { |
|
| 39 | 39 | return $OrderDetail->getProductName() == $productName; |
| 40 | 40 | }); |
| 41 | 41 | return !empty($OrderDetails); |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | */ |
| 223 | 223 | public function getProductQuantity($productClassId) |
| 224 | 224 | { |
| 225 | - $CartItem = $this->cart->getCartItemByIdentifier('Eccube\Entity\ProductClass', (string)$productClassId); |
|
| 225 | + $CartItem = $this->cart->getCartItemByIdentifier('Eccube\Entity\ProductClass', (string) $productClassId); |
|
| 226 | 226 | if ($CartItem) { |
| 227 | 227 | return $CartItem->getQuantity(); |
| 228 | 228 | } else { |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | $CartItem = new CartItem(); |
| 308 | 308 | $CartItem |
| 309 | 309 | ->setClassName('Eccube\Entity\ProductClass') |
| 310 | - ->setClassId((string)$ProductClass->getId()) |
|
| 310 | + ->setClassId((string) $ProductClass->getId()) |
|
| 311 | 311 | ->setPrice($ProductClass->getPrice02IncTax()) |
| 312 | 312 | ->setQuantity($quantity); |
| 313 | 313 | |
@@ -465,7 +465,7 @@ discard block |
||
| 465 | 465 | */ |
| 466 | 466 | public function removeProduct($productClassId) |
| 467 | 467 | { |
| 468 | - $this->cart->removeCartItemByIdentifier('Eccube\Entity\ProductClass', (string)$productClassId); |
|
| 468 | + $this->cart->removeCartItemByIdentifier('Eccube\Entity\ProductClass', (string) $productClassId); |
|
| 469 | 469 | |
| 470 | 470 | // 支払方法の再設定 |
| 471 | 471 | if ($this->BaseInfo->getOptionMultipleShipping() == Constant::ENABLED) { |