@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | { |
67 | 67 | public function register(Application $app) |
68 | 68 | { |
69 | - $app['var_dumper.cloner'] = $app->share(function ($app) { |
|
69 | + $app['var_dumper.cloner'] = $app->share(function($app) { |
|
70 | 70 | $cloner = new VarCloner(); |
71 | 71 | |
72 | 72 | if (isset($app['debug.max_items'])) { |
@@ -85,19 +85,19 @@ discard block |
||
85 | 85 | array(array('dump', '@Debug/Profiler/dump.html.twig')) |
86 | 86 | ); |
87 | 87 | |
88 | - $app['data_collector.dump'] = $app->share(function ($app) { |
|
88 | + $app['data_collector.dump'] = $app->share(function($app) { |
|
89 | 89 | return new DumpDataCollector($app['stopwatch'], $app['code.file_link_format']); |
90 | 90 | }); |
91 | 91 | |
92 | - $app['data_collectors'] = $app->share($app->extend('data_collectors', function ($collectors, $app) { |
|
93 | - $collectors['dump'] = $app->share(function ($app) { |
|
92 | + $app['data_collectors'] = $app->share($app->extend('data_collectors', function($collectors, $app) { |
|
93 | + $collectors['dump'] = $app->share(function($app) { |
|
94 | 94 | return $app['data_collector.dump']; |
95 | 95 | }); |
96 | 96 | |
97 | 97 | return $collectors; |
98 | 98 | })); |
99 | 99 | |
100 | - $app['twig'] = $app->share($app->extend('twig', function ($twig, $app) { |
|
100 | + $app['twig'] = $app->share($app->extend('twig', function($twig, $app) { |
|
101 | 101 | if (class_exists('\Symfony\Bridge\Twig\Extension\DumpExtension')) { |
102 | 102 | $twig->addExtension(new DumpExtension($app['var_dumper.cloner'])); |
103 | 103 | } |
@@ -105,13 +105,13 @@ discard block |
||
105 | 105 | return $twig; |
106 | 106 | })); |
107 | 107 | |
108 | - $app['twig.loader.filesystem'] = $app->share($app->extend('twig.loader.filesystem', function ($loader, $app) { |
|
108 | + $app['twig.loader.filesystem'] = $app->share($app->extend('twig.loader.filesystem', function($loader, $app) { |
|
109 | 109 | $loader->addPath($app['debug.templates_path'], 'Debug'); |
110 | 110 | |
111 | 111 | return $loader; |
112 | 112 | })); |
113 | 113 | |
114 | - $app['debug.templates_path'] = function () { |
|
114 | + $app['debug.templates_path'] = function() { |
|
115 | 115 | $r = new \ReflectionClass('Symfony\Bundle\DebugBundle\DependencyInjection\Configuration'); |
116 | 116 | |
117 | 117 | return dirname(dirname($r->getFileName())).'/Resources/views'; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | // This code is here to lazy load the dump stack. This default |
124 | 124 | // configuration for CLI mode is overridden in HTTP mode on |
125 | 125 | // 'kernel.request' event |
126 | - VarDumper::setHandler(function ($var) use ($app) { |
|
126 | + VarDumper::setHandler(function($var) use ($app) { |
|
127 | 127 | $dumper = new CliDumper(); |
128 | 128 | $dumper->dump($app['var_dumper.cloner']->cloneVar($var)); |
129 | 129 | }); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | // リセットキーの発行・有効期限の設定 |
48 | 48 | $Customer |
49 | 49 | ->setResetKey($app['eccube.repository.customer']->getUniqueResetKey($app)) |
50 | - ->setResetExpire(new \DateTime('+' . $app['config']['customer_reset_expire'] .' min')); |
|
50 | + ->setResetExpire(new \DateTime('+'.$app['config']['customer_reset_expire'].' min')); |
|
51 | 51 | |
52 | 52 | // リセットキーを更新 |
53 | 53 | $app['orm.em']->persist($Customer); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | // ログ出力 |
63 | 63 | $app['monolog']->addInfo( |
64 | - 'send reset password mail to:' . "{$Customer->getId()} {$Customer->getEmail()} {$request->getClientIp()}" |
|
64 | + 'send reset password mail to:'."{$Customer->getId()} {$Customer->getEmail()} {$request->getClientIp()}" |
|
65 | 65 | ); |
66 | 66 | } |
67 | 67 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | // ログ出力 |
117 | 117 | $app['monolog']->addInfo( |
118 | - 'reset password complete:' . "{$Customer->getId()} {$Customer->getEmail()} {$request->getClientIp()}" |
|
118 | + 'reset password complete:'."{$Customer->getId()} {$Customer->getEmail()} {$request->getClientIp()}" |
|
119 | 119 | ); |
120 | 120 | } else { |
121 | 121 | throw new HttpException\AccessDeniedHttpException('不正なアクセスです。'); |
@@ -60,7 +60,7 @@ |
||
60 | 60 | // 会員削除 |
61 | 61 | $email = $Customer->getEmail(); |
62 | 62 | // メールアドレスにダミーをセット |
63 | - $Customer->setEmail(Str::random(60) . '@dummy.dummy'); |
|
63 | + $Customer->setEmail(Str::random(60).'@dummy.dummy'); |
|
64 | 64 | $Customer->setDelFlg(Constant::ENABLED); |
65 | 65 | |
66 | 66 | $app['orm.em']->flush(); |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | new Assert\Callback(array($this, 'validate')), |
97 | 97 | ), |
98 | 98 | )) |
99 | - ->addEventListener(FormEvents::POST_SUBMIT, function ($event) { |
|
99 | + ->addEventListener(FormEvents::POST_SUBMIT, function($event) { |
|
100 | 100 | $form = $event->getForm(); |
101 | 101 | $data = $form->getData(); |
102 | 102 | try { |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $conn = \Doctrine\DBAL\DriverManager::getConnection($connectionParams, $config); |
122 | 122 | $conn->connect(); |
123 | 123 | } catch (\Exception $e) { |
124 | - $form['database']->addError(new FormError('データベースに接続できませんでした。' . $e->getMessage())); |
|
124 | + $form['database']->addError(new FormError('データベースに接続できませんでした。'.$e->getMessage())); |
|
125 | 125 | } |
126 | 126 | }); |
127 | 127 | } |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | public function validate($data, ExecutionContext $context, $param = null) |
138 | 138 | { |
139 | 139 | $parameters = $this->app['request']->get('install_step4'); |
140 | - if ($parameters['database'] != 'pdo_sqlite'){ |
|
140 | + if ($parameters['database'] != 'pdo_sqlite') { |
|
141 | 141 | $context->validateValue($data, array( |
142 | 142 | new Assert\NotBlank() |
143 | 143 | )); |
@@ -454,7 +454,7 @@ |
||
454 | 454 | foreach ($finder as $dir) { |
455 | 455 | if (file_exists($dir->getRealPath().'/config.yml')) { |
456 | 456 | $config = Yaml::parse(file_get_contents($dir->getRealPath().'/config.yml')); |
457 | - }else{ |
|
457 | + } else{ |
|
458 | 458 | $error = 'Application::initDoctrine : config.yamlがみつかりません'.$dir->getRealPath(); |
459 | 459 | $this->log($error, array(), Logger::WARNING); |
460 | 460 | continue; |
@@ -725,7 +725,7 @@ |
||
725 | 725 | * 成功 : trueを返却 |
726 | 726 | * 失敗 : \Doctrine\DBAL\DBALExceptionエラーが発生( 接続に失敗した場合 )、エラー画面を表示しdie() |
727 | 727 | * 備考 : app['debug']がtrueの際は処理を行わない |
728 | - * @return boolean true |
|
728 | + * @return null|boolean true |
|
729 | 729 | * |
730 | 730 | */ |
731 | 731 | protected function checkDatabaseConnection() |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | foreach ($finder as $dir) { |
455 | 455 | if (file_exists($dir->getRealPath().'/config.yml')) { |
456 | 456 | $config = Yaml::parse(file_get_contents($dir->getRealPath().'/config.yml')); |
457 | - }else{ |
|
457 | + } else { |
|
458 | 458 | $error = 'Application::initDoctrine : config.yamlがみつかりません'.$dir->getRealPath(); |
459 | 459 | $this->log($error, array(), Logger::WARNING); |
460 | 460 | continue; |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | //config.ymlのないディレクトリは無視する |
670 | 670 | try { |
671 | 671 | $this['eccube.service.plugin']->checkPluginArchiveContent($dir->getRealPath()); |
672 | - } catch(\Eccube\Exception\PluginException $e) { |
|
672 | + } catch (\Eccube\Exception\PluginException $e) { |
|
673 | 673 | $this['monolog']->warning($e->getMessage()); |
674 | 674 | continue; |
675 | 675 | } |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | foreach ($config['service'] as $service) { |
722 | 722 | $class = '\\Plugin\\'.$config['code'].'\\ServiceProvider\\'.$service; |
723 | 723 | if (!class_exists($class)) { |
724 | - $this['monolog']->warning('該当クラスが見つかりません:' . $class); |
|
724 | + $this['monolog']->warning('該当クラスが見つかりません:'.$class); |
|
725 | 725 | continue; |
726 | 726 | } |
727 | 727 | $this->register(new $class($this)); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | foreach ($images as $img) { |
178 | 178 | foreach ($img as $image) { |
179 | 179 | $extension = $image->getClientOriginalExtension(); |
180 | - $filename = date('mdHis') . uniqid('_') . '.' . $extension; |
|
180 | + $filename = date('mdHis').uniqid('_').'.'.$extension; |
|
181 | 181 | $image->move($app['config']['image_temp_realdir'], $filename); |
182 | 182 | $files[] = $filename; |
183 | 183 | } |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | $app['eccube.event.dispatcher']->dispatch(EccubeEvents::ADMIN_PRODUCT_EDIT_INITIALIZE, $event); |
240 | 240 | |
241 | 241 | if (!$has_class) { |
242 | - $ProductClass->setStockUnlimited((boolean)$ProductClass->getStockUnlimited()); |
|
242 | + $ProductClass->setStockUnlimited((boolean) $ProductClass->getStockUnlimited()); |
|
243 | 243 | $form['class']->setData($ProductClass); |
244 | 244 | } |
245 | 245 | |
@@ -337,7 +337,7 @@ discard block |
||
337 | 337 | $app['orm.em']->persist($ProductImage); |
338 | 338 | |
339 | 339 | // 移動 |
340 | - $file = new File($app['config']['image_temp_realdir'] . '/' . $add_image); |
|
340 | + $file = new File($app['config']['image_temp_realdir'].'/'.$add_image); |
|
341 | 341 | $file->move($app['config']['image_save_realdir']); |
342 | 342 | } |
343 | 343 | |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | |
358 | 358 | // 削除 |
359 | 359 | $fs = new Filesystem(); |
360 | - $fs->remove($app['config']['image_save_realdir'] . '/' . $delete_image); |
|
360 | + $fs->remove($app['config']['image_save_realdir'].'/'.$delete_image); |
|
361 | 361 | } |
362 | 362 | $app['orm.em']->persist($Product); |
363 | 363 | $app['orm.em']->flush(); |
@@ -463,7 +463,7 @@ discard block |
||
463 | 463 | foreach ($deleteImages as $deleteImage) { |
464 | 464 | try { |
465 | 465 | $fs = new Filesystem(); |
466 | - $fs->remove($app['config']['image_save_realdir'] . '/' . $deleteImage); |
|
466 | + $fs->remove($app['config']['image_save_realdir'].'/'.$deleteImage); |
|
467 | 467 | } catch (\Exception $e) { |
468 | 468 | // エラーが発生しても無視する |
469 | 469 | } |
@@ -527,10 +527,10 @@ discard block |
||
527 | 527 | |
528 | 528 | // 画像ファイルを新規作成 |
529 | 529 | $extension = pathinfo($Image->getFileName(), PATHINFO_EXTENSION); |
530 | - $filename = date('mdHis') . uniqid('_') . '.' . $extension; |
|
530 | + $filename = date('mdHis').uniqid('_').'.'.$extension; |
|
531 | 531 | try { |
532 | 532 | $fs = new Filesystem(); |
533 | - $fs->copy($app['config']['image_save_realdir'] . '/' . $Image->getFileName(), $app['config']['image_save_realdir'] . '/' . $filename); |
|
533 | + $fs->copy($app['config']['image_save_realdir'].'/'.$Image->getFileName(), $app['config']['image_save_realdir'].'/'.$filename); |
|
534 | 534 | } catch (\Exception $e) { |
535 | 535 | // エラーが発生しても無視する |
536 | 536 | } |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | $em->getConfiguration()->setSQLLogger(null); |
586 | 586 | |
587 | 587 | $response = new StreamedResponse(); |
588 | - $response->setCallback(function () use ($app, $request) { |
|
588 | + $response->setCallback(function() use ($app, $request) { |
|
589 | 589 | |
590 | 590 | // CSV種別を元に初期化. |
591 | 591 | $app['eccube.service.csv.export']->initCsvType(CsvType::CSV_TYPE_PRODUCT); |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | |
610 | 610 | // データ行の出力. |
611 | 611 | $app['eccube.service.csv.export']->setExportQueryBuilder($qb); |
612 | - $app['eccube.service.csv.export']->exportData(function ($entity, $csvService) { |
|
612 | + $app['eccube.service.csv.export']->exportData(function($entity, $csvService) { |
|
613 | 613 | |
614 | 614 | $Csvs = $csvService->getCsvs(); |
615 | 615 | |
@@ -641,9 +641,9 @@ discard block |
||
641 | 641 | }); |
642 | 642 | |
643 | 643 | $now = new \DateTime(); |
644 | - $filename = 'product_' . $now->format('YmdHis') . '.csv'; |
|
644 | + $filename = 'product_'.$now->format('YmdHis').'.csv'; |
|
645 | 645 | $response->headers->set('Content-Type', 'application/octet-stream'); |
646 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
646 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
647 | 647 | $response->send(); |
648 | 648 | |
649 | 649 | return $response; |
@@ -29,7 +29,6 @@ |
||
29 | 29 | use Symfony\Component\EventDispatcher\EventSubscriberInterface; |
30 | 30 | use Symfony\Component\Finder\Finder; |
31 | 31 | use Symfony\Component\Yaml\Yaml; |
32 | -use Monolog\Logger; |
|
33 | 32 | |
34 | 33 | class FormEventSubscriber implements EventSubscriberInterface |
35 | 34 | { |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | { |
38 | 38 | $events = array(); |
39 | 39 | // YamlでParseしてがんばる |
40 | - $basePath = __DIR__ . '/../../../app/Plugin'; |
|
40 | + $basePath = __DIR__.'/../../../app/Plugin'; |
|
41 | 41 | $finder = Finder::create() |
42 | 42 | ->in($basePath) |
43 | 43 | ->directories() |
@@ -46,18 +46,18 @@ discard block |
||
46 | 46 | $app = \Eccube\Application::getInstance(); |
47 | 47 | |
48 | 48 | foreach ($finder as $dir) { |
49 | - $config = Yaml::parse(file_get_contents($dir->getRealPath() . '/config.yml')); |
|
49 | + $config = Yaml::parse(file_get_contents($dir->getRealPath().'/config.yml')); |
|
50 | 50 | try { |
51 | 51 | $app['eccube.service.plugin']->checkPluginArchiveContent($dir->getRealPath()); |
52 | - } catch(\Eccube\Exception\PluginException $e) { |
|
52 | + } catch (\Eccube\Exception\PluginException $e) { |
|
53 | 53 | $app['monolog']->warning($e->getMessage()); |
54 | 54 | continue; |
55 | 55 | } |
56 | - $config = $app['eccube.service.plugin']->readYml($dir->getRealPath() . '/config.yml'); |
|
56 | + $config = $app['eccube.service.plugin']->readYml($dir->getRealPath().'/config.yml'); |
|
57 | 57 | |
58 | 58 | if (isset($config['form'])) { |
59 | 59 | foreach ($config['form'] as $event => $class) { |
60 | - $events[$event][] = '\\Plugin\\' . $config['code'] . '\\' . $class; |
|
60 | + $events[$event][] = '\\Plugin\\'.$config['code'].'\\'.$class; |
|
61 | 61 | } |
62 | 62 | } |
63 | 63 | } |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | $events = self::getEvents(); |
82 | 82 | |
83 | 83 | if (isset($events['onPreSetData'])) { |
84 | - foreach($events['onPreSetData'] as $formEventClass) { |
|
84 | + foreach ($events['onPreSetData'] as $formEventClass) { |
|
85 | 85 | $formEvent = new $formEventClass(); |
86 | 86 | $formEvent->onPreSetData($event); |
87 | 87 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $events = self::getEvents(); |
94 | 94 | |
95 | 95 | if (isset($events['onPostSetData'])) { |
96 | - foreach($events['onPostSetData'] as $formEventClass) { |
|
96 | + foreach ($events['onPostSetData'] as $formEventClass) { |
|
97 | 97 | $formEvent = new $formEventClass(); |
98 | 98 | $formEvent->onPostSetData($event); |
99 | 99 | } |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $events = self::getEvents(); |
106 | 106 | |
107 | 107 | if (isset($events['onPreSubmit'])) { |
108 | - foreach($events['onPreSubmit'] as $formEventClass) { |
|
108 | + foreach ($events['onPreSubmit'] as $formEventClass) { |
|
109 | 109 | $formEvent = new $formEventClass(); |
110 | 110 | $formEvent->onPreSubmit($event); |
111 | 111 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $events = self::getEvents(); |
118 | 118 | |
119 | 119 | if (isset($events['onSubmit'])) { |
120 | - foreach($events['onSubmit'] as $formEventClass) { |
|
120 | + foreach ($events['onSubmit'] as $formEventClass) { |
|
121 | 121 | $formEvent = new $formEventClass(); |
122 | 122 | $formEvent->onSubmit($event); |
123 | 123 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $events = self::getEvents(); |
130 | 130 | |
131 | 131 | if (isset($events['onPostSubmit'])) { |
132 | - foreach($events['onPostSubmit'] as $formEventClass) { |
|
132 | + foreach ($events['onPostSubmit'] as $formEventClass) { |
|
133 | 133 | $formEvent = new $formEventClass(); |
134 | 134 | $formEvent->onPostSubmit($event); |
135 | 135 | } |
@@ -106,7 +106,7 @@ |
||
106 | 106 | )); |
107 | 107 | $addCartForm = $builder->getForm(); |
108 | 108 | |
109 | - if ($request->getMethod() === 'POST' && (string)$Product->getId() === $request->get('product_id')) { |
|
109 | + if ($request->getMethod() === 'POST' && (string) $Product->getId() === $request->get('product_id')) { |
|
110 | 110 | $addCartForm->handleRequest($request); |
111 | 111 | |
112 | 112 | if ($addCartForm->isValid()) { |
@@ -20,32 +20,32 @@ discard block |
||
20 | 20 | */ |
21 | 21 | public function addSuccess($message, $namespace = 'front') |
22 | 22 | { |
23 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.success', $message); |
|
23 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.success', $message); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | public function addError($message, $namespace = 'front') |
27 | 27 | { |
28 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.error', $message); |
|
28 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.error', $message); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | public function addDanger($message, $namespace = 'front') |
32 | 32 | { |
33 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.danger', $message); |
|
33 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.danger', $message); |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | public function addWarning($message, $namespace = 'front') |
37 | 37 | { |
38 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.warning', $message); |
|
38 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.warning', $message); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | public function addInfo($message, $namespace = 'front') |
42 | 42 | { |
43 | - $this['session']->getFlashBag()->add('eccube.' . $namespace . '.info', $message); |
|
43 | + $this['session']->getFlashBag()->add('eccube.'.$namespace.'.info', $message); |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | public function addRequestError($message, $namespace = 'front') |
47 | 47 | { |
48 | - $this['session']->getFlashBag()->set('eccube.' . $namespace . '.request.error', $message); |
|
48 | + $this['session']->getFlashBag()->set('eccube.'.$namespace.'.request.error', $message); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | public function clearMessage() |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | if (is_null($namespace)) { |
65 | 65 | $this['session']->getFlashBag()->set('eccube.login.target.path', $targetPath); |
66 | 66 | } else { |
67 | - $this['session']->getFlashBag()->set('eccube.' . $namespace . '.login.target.path', $targetPath); |
|
67 | + $this['session']->getFlashBag()->set('eccube.'.$namespace.'.login.target.path', $targetPath); |
|
68 | 68 | } |
69 | 69 | } |
70 | 70 | |
@@ -234,14 +234,14 @@ discard block |
||
234 | 234 | $eventName = $view; |
235 | 235 | if ($this->isAdminRequest()) { |
236 | 236 | // 管理画面の場合、event名に「Admin/」を付ける |
237 | - $eventName = 'Admin/' . $view; |
|
237 | + $eventName = 'Admin/'.$view; |
|
238 | 238 | } |
239 | - $this['monolog']->debug('Template Event Name : ' . $eventName); |
|
239 | + $this['monolog']->debug('Template Event Name : '.$eventName); |
|
240 | 240 | |
241 | 241 | $this['eccube.event.dispatcher']->dispatch($eventName, $event); |
242 | 242 | |
243 | 243 | if ($response instanceof StreamedResponse) { |
244 | - $response->setCallback(function () use ($twig, $view, $parameters) { |
|
244 | + $response->setCallback(function() use ($twig, $view, $parameters) { |
|
245 | 245 | $twig->display($view, $parameters); |
246 | 246 | }); |
247 | 247 | } else { |