@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | } |
203 | 203 | |
204 | 204 | $extension = $image->getClientOriginalExtension(); |
205 | - $filename = date('mdHis') . uniqid('_') . '.' . $extension; |
|
205 | + $filename = date('mdHis').uniqid('_').'.'.$extension; |
|
206 | 206 | $image->move($app['config']['image_temp_realdir'], $filename); |
207 | 207 | $files[] = $filename; |
208 | 208 | } |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | $form = $builder->getForm(); |
279 | 279 | |
280 | 280 | if (!$has_class) { |
281 | - $ProductClass->setStockUnlimited((boolean)$ProductClass->getStockUnlimited()); |
|
281 | + $ProductClass->setStockUnlimited((boolean) $ProductClass->getStockUnlimited()); |
|
282 | 282 | $form['class']->setData($ProductClass); |
283 | 283 | } |
284 | 284 | |
@@ -364,8 +364,8 @@ discard block |
||
364 | 364 | $Categories = $form->get('Category')->getData(); |
365 | 365 | $categoriesIdList = array(); |
366 | 366 | foreach ($Categories as $Category) { |
367 | - foreach($Category->getPath() as $ParentCategory){ |
|
368 | - if (!isset($categoriesIdList[$ParentCategory->getId()])){ |
|
367 | + foreach ($Category->getPath() as $ParentCategory) { |
|
368 | + if (!isset($categoriesIdList[$ParentCategory->getId()])) { |
|
369 | 369 | $ProductCategory = $this->createProductCategory($Product, $ParentCategory, $count); |
370 | 370 | $app['orm.em']->persist($ProductCategory); |
371 | 371 | $count++; |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $categoriesIdList[$ParentCategory->getId()] = true; |
375 | 375 | } |
376 | 376 | } |
377 | - if (!isset($categoriesIdList[$Category->getId()])){ |
|
377 | + if (!isset($categoriesIdList[$Category->getId()])) { |
|
378 | 378 | $ProductCategory = $this->createProductCategory($Product, $Category, $count); |
379 | 379 | $app['orm.em']->persist($ProductCategory); |
380 | 380 | $count++; |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | $app['orm.em']->persist($ProductImage); |
397 | 397 | |
398 | 398 | // 移動 |
399 | - $file = new File($app['config']['image_temp_realdir'] . '/' . $add_image); |
|
399 | + $file = new File($app['config']['image_temp_realdir'].'/'.$add_image); |
|
400 | 400 | $file->move($app['config']['image_save_realdir']); |
401 | 401 | } |
402 | 402 | |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | |
417 | 417 | // 削除 |
418 | 418 | $fs = new Filesystem(); |
419 | - $fs->remove($app['config']['image_save_realdir'] . '/' . $delete_image); |
|
419 | + $fs->remove($app['config']['image_save_realdir'].'/'.$delete_image); |
|
420 | 420 | } |
421 | 421 | $app['orm.em']->persist($Product); |
422 | 422 | $app['orm.em']->flush(); |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | foreach ($deleteImages as $deleteImage) { |
575 | 575 | try { |
576 | 576 | $fs = new Filesystem(); |
577 | - $fs->remove($app['config']['image_save_realdir'] . '/' . $deleteImage); |
|
577 | + $fs->remove($app['config']['image_save_realdir'].'/'.$deleteImage); |
|
578 | 578 | } catch (\Exception $e) { |
579 | 579 | // エラーが発生しても無視する |
580 | 580 | } |
@@ -644,10 +644,10 @@ discard block |
||
644 | 644 | |
645 | 645 | // 画像ファイルを新規作成 |
646 | 646 | $extension = pathinfo($Image->getFileName(), PATHINFO_EXTENSION); |
647 | - $filename = date('mdHis') . uniqid('_') . '.' . $extension; |
|
647 | + $filename = date('mdHis').uniqid('_').'.'.$extension; |
|
648 | 648 | try { |
649 | 649 | $fs = new Filesystem(); |
650 | - $fs->copy($app['config']['image_save_realdir'] . '/' . $Image->getFileName(), $app['config']['image_save_realdir'] . '/' . $filename); |
|
650 | + $fs->copy($app['config']['image_save_realdir'].'/'.$Image->getFileName(), $app['config']['image_save_realdir'].'/'.$filename); |
|
651 | 651 | } catch (\Exception $e) { |
652 | 652 | // エラーが発生しても無視する |
653 | 653 | } |
@@ -722,7 +722,7 @@ discard block |
||
722 | 722 | $em->getConfiguration()->setSQLLogger(null); |
723 | 723 | |
724 | 724 | $response = new StreamedResponse(); |
725 | - $response->setCallback(function () use ($app, $request) { |
|
725 | + $response->setCallback(function() use ($app, $request) { |
|
726 | 726 | |
727 | 727 | // CSV種別を元に初期化. |
728 | 728 | $app['eccube.service.csv.export']->initCsvType(CsvType::CSV_TYPE_PRODUCT); |
@@ -746,7 +746,7 @@ discard block |
||
746 | 746 | |
747 | 747 | // データ行の出力. |
748 | 748 | $app['eccube.service.csv.export']->setExportQueryBuilder($qb); |
749 | - $app['eccube.service.csv.export']->exportData(function ($entity, $csvService) { |
|
749 | + $app['eccube.service.csv.export']->exportData(function($entity, $csvService) { |
|
750 | 750 | |
751 | 751 | $Csvs = $csvService->getCsvs(); |
752 | 752 | |
@@ -778,9 +778,9 @@ discard block |
||
778 | 778 | }); |
779 | 779 | |
780 | 780 | $now = new \DateTime(); |
781 | - $filename = 'product_' . $now->format('YmdHis') . '.csv'; |
|
781 | + $filename = 'product_'.$now->format('YmdHis').'.csv'; |
|
782 | 782 | $response->headers->set('Content-Type', 'application/octet-stream'); |
783 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
783 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
784 | 784 | $response->send(); |
785 | 785 | |
786 | 786 | log_info('商品CSV出力ファイル名', array($filename)); |
@@ -20,17 +20,17 @@ discard block |
||
20 | 20 | $app->register(new \Silex\Provider\MonologServiceProvider()); |
21 | 21 | |
22 | 22 | // Log |
23 | - $app['eccube.logger'] = $app->share(function ($app) { |
|
23 | + $app['eccube.logger'] = $app->share(function($app) { |
|
24 | 24 | return new Logger($app); |
25 | 25 | }); |
26 | 26 | |
27 | 27 | // ヘルパー作成 |
28 | - $app['eccube.monolog.helper'] = $app->share(function ($app) { |
|
28 | + $app['eccube.monolog.helper'] = $app->share(function($app) { |
|
29 | 29 | return new LogHelper($app); |
30 | 30 | }); |
31 | 31 | |
32 | 32 | // ログクラス作成ファクトリー |
33 | - $app['eccube.monolog.factory'] = $app->protect(function (array $channelValues) use ($app) { |
|
33 | + $app['eccube.monolog.factory'] = $app->protect(function(array $channelValues) use ($app) { |
|
34 | 34 | |
35 | 35 | $log = new $app['monolog.logger.class']($channelValues['name']); |
36 | 36 | |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | // monologの設定は除外 |
46 | 46 | unset($channels['monolog']); |
47 | 47 | foreach ($channels as $channel => $channelValues) { |
48 | - $app['monolog.logger.'.$channel] = $app->share(function ($app) use ($channelValues) { |
|
48 | + $app['monolog.logger.'.$channel] = $app->share(function($app) use ($channelValues) { |
|
49 | 49 | return $app['eccube.monolog.factory']($channelValues); |
50 | 50 | }); |
51 | 51 | } |
@@ -53,15 +53,15 @@ discard block |
||
53 | 53 | // MonologServiceProviderで定義されているmonolog.handlerの置換 |
54 | 54 | $channelValues = $app['config']['log']['channel']['monolog']; |
55 | 55 | $app['monolog.name'] = $channelValues['name']; |
56 | - $app['monolog.handler'] = $app->share(function ($app) use ($channelValues) { |
|
56 | + $app['monolog.handler'] = $app->share(function($app) use ($channelValues) { |
|
57 | 57 | return $app['eccube.monolog.helper']->getHandler($channelValues); |
58 | 58 | }); |
59 | 59 | |
60 | - $app['eccube.monolog.listener'] = $app->share(function () use ($app) { |
|
60 | + $app['eccube.monolog.listener'] = $app->share(function() use ($app) { |
|
61 | 61 | return new LogListener($app['eccube.logger']); |
62 | 62 | }); |
63 | 63 | |
64 | - $app['listener.requestdump'] = $app->share(function ($app) { |
|
64 | + $app['listener.requestdump'] = $app->share(function($app) { |
|
65 | 65 | return new \Eccube\EventListener\RequestDumpListener($app); |
66 | 66 | }); |
67 | 67 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | if ($this->count === null) { |
122 | 122 | try { |
123 | 123 | $this->count = array_sum(array_map('current', $this->getCountQuery()->getScalarResult())); |
124 | - } catch(NoResultException $e) { |
|
124 | + } catch (NoResultException $e) { |
|
125 | 125 | $this->count = 0; |
126 | 126 | } |
127 | 127 | } |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | /* @var $countQuery Query */ |
242 | 242 | $countQuery = $this->cloneQuery($this->query); |
243 | 243 | |
244 | - if ( ! $countQuery->hasHint(CountWalker::HINT_DISTINCT)) { |
|
244 | + if (!$countQuery->hasHint(CountWalker::HINT_DISTINCT)) { |
|
245 | 245 | $countQuery->setHint(CountWalker::HINT_DISTINCT, true); |
246 | 246 | } |
247 | 247 | |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | foreach ($parameters as $key => $parameter) { |
268 | 268 | $parameterName = $parameter->getName(); |
269 | 269 | |
270 | - if( ! (isset($parameterMappings[$parameterName]) || array_key_exists($parameterName, $parameterMappings))) { |
|
270 | + if (!(isset($parameterMappings[$parameterName]) || array_key_exists($parameterName, $parameterMappings))) { |
|
271 | 271 | unset($parameters[$key]); |
272 | 272 | } |
273 | 273 | } |
@@ -44,9 +44,9 @@ |
||
44 | 44 | */ |
45 | 45 | public function getSql(\Doctrine\ORM\Query\SqlWalker $sqlWalker) |
46 | 46 | { |
47 | - return 'ROW_NUMBER() OVER(' . trim($sqlWalker->walkOrderByClause( |
|
47 | + return 'ROW_NUMBER() OVER('.trim($sqlWalker->walkOrderByClause( |
|
48 | 48 | $this->orderByClause |
49 | - )) . ')'; |
|
49 | + )).')'; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -209,8 +209,8 @@ discard block |
||
209 | 209 | $sqlIdentifier = $this->getSQLIdentifier($AST); |
210 | 210 | |
211 | 211 | if ($hasOrderBy) { |
212 | - $orderGroupBy = ' GROUP BY ' . implode(', ', $sqlIdentifier); |
|
213 | - $sqlIdentifier[] = 'MIN(' . $this->walkResultVariable('dctrn_rownum') . ') AS dctrn_minrownum'; |
|
212 | + $orderGroupBy = ' GROUP BY '.implode(', ', $sqlIdentifier); |
|
213 | + $sqlIdentifier[] = 'MIN('.$this->walkResultVariable('dctrn_rownum').') AS dctrn_minrownum'; |
|
214 | 214 | } |
215 | 215 | |
216 | 216 | // Build the counter query |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | ); |
222 | 222 | |
223 | 223 | if ($hasOrderBy) { |
224 | - $sql .= $orderGroupBy . $outerOrderBy; |
|
224 | + $sql .= $orderGroupBy.$outerOrderBy; |
|
225 | 225 | } |
226 | 226 | |
227 | 227 | // Apply the limit and offset. |
@@ -368,7 +368,7 @@ discard block |
||
368 | 368 | { |
369 | 369 | // If the sql statement has an order by clause, we need to wrap it in a new select distinct |
370 | 370 | // statement |
371 | - if (! $orderByClause instanceof OrderByClause) { |
|
371 | + if (!$orderByClause instanceof OrderByClause) { |
|
372 | 372 | return $sql; |
373 | 373 | } |
374 | 374 | |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | = array(); |
421 | 421 | |
422 | 422 | // Generate DQL alias -> SQL table alias mapping |
423 | - foreach(array_keys($this->rsm->aliasMap) as $dqlAlias) { |
|
423 | + foreach (array_keys($this->rsm->aliasMap) as $dqlAlias) { |
|
424 | 424 | $dqlAliasToClassMap[$dqlAlias] = $class = $this->queryComponents[$dqlAlias]['metadata']; |
425 | 425 | $dqlAliasToSqlTableAliasMap[$dqlAlias] = $this->getSQLTableAlias($class->getTableName(), $dqlAlias); |
426 | 426 | } |
@@ -429,7 +429,7 @@ discard block |
||
429 | 429 | $fieldSearchPattern = '/(?<![a-z0-9_])%s\.%s(?![a-z0-9_])/i'; |
430 | 430 | |
431 | 431 | // Generate search patterns for each field's path expression in the order by clause |
432 | - foreach($this->rsm->fieldMappings as $fieldAlias => $fieldName) { |
|
432 | + foreach ($this->rsm->fieldMappings as $fieldAlias => $fieldName) { |
|
433 | 433 | $dqlAliasForFieldAlias = $this->rsm->columnOwnerMap[$fieldAlias]; |
434 | 434 | $class = $dqlAliasToClassMap[$dqlAliasForFieldAlias]; |
435 | 435 | |
@@ -465,7 +465,7 @@ discard block |
||
465 | 465 | $replacements[] = $fieldAlias; |
466 | 466 | } |
467 | 467 | |
468 | - foreach($orderByClause->orderByItems as $orderByItem) { |
|
468 | + foreach ($orderByClause->orderByItems as $orderByItem) { |
|
469 | 469 | // Walk order by item to get string representation of it |
470 | 470 | $orderByItemString = $this->walkOrderByItem($orderByItem); |
471 | 471 |
@@ -69,7 +69,7 @@ |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | $pathExpression = new PathExpression( |
72 | - PathExpression::TYPE_STATE_FIELD | PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, $rootAlias, |
|
72 | + PathExpression::TYPE_STATE_FIELD|PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, $rootAlias, |
|
73 | 73 | $identifierFieldName |
74 | 74 | ); |
75 | 75 | $pathExpression->type = $pathType; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | ); |
94 | 94 | |
95 | 95 | $pathExpression = new PathExpression( |
96 | - PathExpression::TYPE_STATE_FIELD | PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, |
|
96 | + PathExpression::TYPE_STATE_FIELD|PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, |
|
97 | 97 | $rootAlias, |
98 | 98 | $identifier |
99 | 99 | ); |
@@ -104,13 +104,13 @@ discard block |
||
104 | 104 | |
105 | 105 | if (isset($AST->orderByClause)) { |
106 | 106 | foreach ($AST->orderByClause->orderByItems as $item) { |
107 | - if ( ! $item->expression instanceof PathExpression) { |
|
107 | + if (!$item->expression instanceof PathExpression) { |
|
108 | 108 | continue; |
109 | 109 | } |
110 | 110 | |
111 | 111 | $AST->selectClause->selectExpressions[] = new SelectExpression( |
112 | 112 | $this->createSelectExpressionItem($item->expression), |
113 | - '_dctrn_ord' . $this->_aliasCounter++ |
|
113 | + '_dctrn_ord'.$this->_aliasCounter++ |
|
114 | 114 | ); |
115 | 115 | } |
116 | 116 | } |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | && isset($queryComponents[$expression->identificationVariable])) { |
146 | 146 | $queryComponent = $queryComponents[$expression->identificationVariable]; |
147 | 147 | if (isset($queryComponent['parent']) |
148 | - && $queryComponent['relation']['type'] & ClassMetadataInfo::TO_MANY) { |
|
148 | + && $queryComponent['relation']['type']&ClassMetadataInfo::TO_MANY) { |
|
149 | 149 | throw new \RuntimeException("Cannot select distinct identifiers from query with LIMIT and ORDER BY on a column from a fetch joined to-many association. Use output walkers."); |
150 | 150 | } |
151 | 151 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | $pathType = PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION; |
90 | 90 | } |
91 | 91 | |
92 | - $pathExpression = new PathExpression(PathExpression::TYPE_STATE_FIELD | PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, $rootAlias, $identifierFieldName); |
|
92 | + $pathExpression = new PathExpression(PathExpression::TYPE_STATE_FIELD|PathExpression::TYPE_SINGLE_VALUED_ASSOCIATION, $rootAlias, $identifierFieldName); |
|
93 | 93 | $pathExpression->type = $pathType; |
94 | 94 | |
95 | 95 | $count = $this->_getQuery()->getHint(self::HINT_PAGINATOR_ID_COUNT); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | array($pathExpression) |
101 | 101 | ); |
102 | 102 | $expression = new InExpression($arithmeticExpression); |
103 | - $expression->literals[] = new InputParameter(":" . self::PAGINATOR_ID_ALIAS); |
|
103 | + $expression->literals[] = new InputParameter(":".self::PAGINATOR_ID_ALIAS); |
|
104 | 104 | |
105 | 105 | } else { |
106 | 106 | $expression = new NullComparisonExpression($pathExpression); |
@@ -39,7 +39,7 @@ |
||
39 | 39 | |
40 | 40 | if (is_writable($logDir)) { |
41 | 41 | if (file_exists($installLog) && !is_writable($installLog)) { |
42 | - die($installLog . ' の書込権限を変更して下さい。'); |
|
42 | + die($installLog.' の書込権限を変更して下さい。'); |
|
43 | 43 | } |
44 | 44 | // install step2 でログディレクトリに書き込み権限が付与されればログ出力を開始する. |
45 | 45 | $app->register(new \Silex\Provider\MonologServiceProvider(), array( |