@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | protected function calculateTotal(ItemHolderInterface $itemHolder) |
| 106 | 106 | { |
| 107 | - $total = $itemHolder->getItems()->reduce(function ($sum, ItemInterface $item) { |
|
| 107 | + $total = $itemHolder->getItems()->reduce(function($sum, ItemInterface $item) { |
|
| 108 | 108 | $sum += $item->getPriceIncTax() * $item->getQuantity(); |
| 109 | 109 | |
| 110 | 110 | return $sum; |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | { |
| 122 | 122 | $total = $itemHolder->getItems() |
| 123 | 123 | ->getProductClasses() |
| 124 | - ->reduce(function ($sum, ItemInterface $item) { |
|
| 124 | + ->reduce(function($sum, ItemInterface $item) { |
|
| 125 | 125 | $sum += $item->getPriceIncTax() * $item->getQuantity(); |
| 126 | 126 | |
| 127 | 127 | return $sum; |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | { |
| 141 | 141 | $total = $itemHolder->getItems() |
| 142 | 142 | ->getDeliveryFees() |
| 143 | - ->reduce(function ($sum, ItemInterface $item) { |
|
| 143 | + ->reduce(function($sum, ItemInterface $item) { |
|
| 144 | 144 | $sum += $item->getPriceIncTax() * $item->getQuantity(); |
| 145 | 145 | |
| 146 | 146 | return $sum; |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | { |
| 156 | 156 | $total = $itemHolder->getItems() |
| 157 | 157 | ->getDiscounts() |
| 158 | - ->reduce(function ($sum, ItemInterface $item) { |
|
| 158 | + ->reduce(function($sum, ItemInterface $item) { |
|
| 159 | 159 | $sum += $item->getPriceIncTax() * $item->getQuantity(); |
| 160 | 160 | |
| 161 | 161 | return $sum; |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | { |
| 172 | 172 | $total = $itemHolder->getItems() |
| 173 | 173 | ->getCharges() |
| 174 | - ->reduce(function ($sum, ItemInterface $item) { |
|
| 174 | + ->reduce(function($sum, ItemInterface $item) { |
|
| 175 | 175 | $sum += $item->getPriceIncTax() * $item->getQuantity(); |
| 176 | 176 | |
| 177 | 177 | return $sum; |
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | protected function calculateTax(ItemHolderInterface $itemHolder) |
| 186 | 186 | { |
| 187 | 187 | $total = $itemHolder->getItems() |
| 188 | - ->reduce(function ($sum, ItemInterface $item) { |
|
| 188 | + ->reduce(function($sum, ItemInterface $item) { |
|
| 189 | 189 | $sum += ($item->getPriceIncTax() - $item->getPrice()) * $item->getQuantity(); |
| 190 | 190 | |
| 191 | 191 | return $sum; |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | */ |
| 54 | 54 | public function getErrors() |
| 55 | 55 | { |
| 56 | - return array_filter($this->processResults, function (ProcessResult $processResult) { |
|
| 56 | + return array_filter($this->processResults, function(ProcessResult $processResult) { |
|
| 57 | 57 | return $processResult->isError(); |
| 58 | 58 | }); |
| 59 | 59 | } |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | */ |
| 64 | 64 | public function getWarning() |
| 65 | 65 | { |
| 66 | - return array_filter($this->processResults, function (ProcessResult $processResult) { |
|
| 66 | + return array_filter($this->processResults, function(ProcessResult $processResult) { |
|
| 67 | 67 | return $processResult->isWarning(); |
| 68 | 68 | }); |
| 69 | 69 | } |
@@ -59,11 +59,17 @@ |
||
| 59 | 59 | */ |
| 60 | 60 | protected $formFactory; |
| 61 | 61 | |
| 62 | + /** |
|
| 63 | + * @param \Eccube\Application $app |
|
| 64 | + */ |
|
| 62 | 65 | protected function getSecurity($app) |
| 63 | 66 | { |
| 64 | 67 | return $this->tokenStorage; |
| 65 | 68 | } |
| 66 | 69 | |
| 70 | + /** |
|
| 71 | + * @param \Eccube\Application $app |
|
| 72 | + */ |
|
| 67 | 73 | protected function isTokenValid($app) |
| 68 | 74 | { |
| 69 | 75 | $csrf = $this->csrfTokenManager; |
@@ -41,7 +41,6 @@ |
||
| 41 | 41 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method; |
| 42 | 42 | use Symfony\Component\EventDispatcher\EventDispatcher; |
| 43 | 43 | use Symfony\Component\Filesystem\Filesystem; |
| 44 | -use Symfony\Component\Finder\Finder; |
|
| 45 | 44 | use Symfony\Component\Form\FormFactory; |
| 46 | 45 | use Symfony\Component\HttpFoundation\Request; |
| 47 | 46 | use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | // ファイル生成・更新 |
| 175 | 175 | $tplDir = $this->appConfig['block_realdir']; |
| 176 | 176 | |
| 177 | - $filePath = $tplDir . '/' . $Block->getFileName() . '.twig'; |
|
| 177 | + $filePath = $tplDir.'/'.$Block->getFileName().'.twig'; |
|
| 178 | 178 | |
| 179 | 179 | $fs = new Filesystem(); |
| 180 | 180 | $blockData = $form->get('block_html')->getData(); |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | $fs->dumpFile($filePath, $blockData); |
| 183 | 183 | // 更新でファイル名を変更した場合、以前のファイルを削除 |
| 184 | 184 | if ($Block->getFileName() != $previous_filename && !is_null($previous_filename)) { |
| 185 | - $oldFilePath = $tplDir . '/' . $previous_filename . '.twig'; |
|
| 185 | + $oldFilePath = $tplDir.'/'.$previous_filename.'.twig'; |
|
| 186 | 186 | if ($fs->exists($oldFilePath)) { |
| 187 | 187 | $fs->remove($oldFilePath); |
| 188 | 188 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | // テンプレートが変更されていた場合、DBからはブロック削除されるがtwigファイルは残る |
| 240 | 240 | if ($Block->getDeletableFlg() > 0) { |
| 241 | 241 | $tplDir = $this->appConfig['block_realdir']; |
| 242 | - $file = $tplDir . '/' . $Block->getFileName() . '.twig'; |
|
| 242 | + $file = $tplDir.'/'.$Block->getFileName().'.twig'; |
|
| 243 | 243 | $fs = new Filesystem(); |
| 244 | 244 | if ($fs->exists($file)) { |
| 245 | 245 | $fs->remove($file); |
@@ -270,6 +270,10 @@ discard block |
||
| 270 | 270 | return $str; |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | + /** |
|
| 274 | + * @param string $topDir |
|
| 275 | + * @param Request $request |
|
| 276 | + */ |
|
| 273 | 277 | private function getTree($topDir, $request) |
| 274 | 278 | { |
| 275 | 279 | $finder = Finder::create()->in($topDir) |
@@ -307,6 +311,10 @@ discard block |
||
| 307 | 311 | return $tree; |
| 308 | 312 | } |
| 309 | 313 | |
| 314 | + /** |
|
| 315 | + * @param Application $app |
|
| 316 | + * @param string $nowDir |
|
| 317 | + */ |
|
| 310 | 318 | private function getFileList($app, $nowDir) |
| 311 | 319 | { |
| 312 | 320 | $topDir = $this->appConfig['user_data_realdir']; |
@@ -366,6 +374,9 @@ discard block |
||
| 366 | 374 | return (strpos($targetDir, $topDir) === 0); |
| 367 | 375 | } |
| 368 | 376 | |
| 377 | + /** |
|
| 378 | + * @return string |
|
| 379 | + */ |
|
| 369 | 380 | private function convertStrFromServer($target) |
| 370 | 381 | { |
| 371 | 382 | if ($this->encode == self::SJIS) { |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | private $error = null; |
| 65 | 65 | private $encode = ''; |
| 66 | 66 | |
| 67 | - public function __construct(){ |
|
| 67 | + public function __construct() { |
|
| 68 | 68 | $this->encode = self::UTF; |
| 69 | 69 | if ('\\' === DIRECTORY_SEPARATOR) { |
| 70 | 70 | $this->encode = self::SJIS; |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $arrFileList = $this->getFileList($app, $nowDir); |
| 114 | 114 | |
| 115 | 115 | $javascript = $this->getJsArrayList($tree); |
| 116 | - $onload = "eccube.fileManager.viewFileTree('tree', arrTree, '" . $nowDir . "', 'tree_select_file', 'tree_status', 'move');"; |
|
| 116 | + $onload = "eccube.fileManager.viewFileTree('tree', arrTree, '".$nowDir."', 'tree_select_file', 'tree_status', 'move');"; |
|
| 117 | 117 | |
| 118 | 118 | return [ |
| 119 | 119 | 'form' => $form->createView(), |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | $nowDir = $this->checkDir($request->get('now_dir'), $topDir) |
| 175 | 175 | ? $this->normalizePath($request->get('now_dir')) |
| 176 | 176 | : $topDir; |
| 177 | - $fs->mkdir($nowDir . '/' . $filename); |
|
| 177 | + $fs->mkdir($nowDir.'/'.$filename); |
|
| 178 | 178 | } |
| 179 | 179 | } |
| 180 | 180 | } |
@@ -259,7 +259,7 @@ discard block |
||
| 259 | 259 | { |
| 260 | 260 | $str = "arrTree = new Array();\n"; |
| 261 | 261 | foreach ($tree as $key => $val) { |
| 262 | - $str .= 'arrTree[' . $key . "] = new Array(" . $key . ", '" . $val['type'] . "', '" . $val['path'] . "', " . $val['rank'] . ','; |
|
| 262 | + $str .= 'arrTree['.$key."] = new Array(".$key.", '".$val['type']."', '".$val['path']."', ".$val['rank'].','; |
|
| 263 | 263 | if ($val['open']) { |
| 264 | 264 | $str .= "true);\n"; |
| 265 | 265 | } else { |
@@ -310,7 +310,7 @@ discard block |
||
| 310 | 310 | private function getFileList($app, $nowDir) |
| 311 | 311 | { |
| 312 | 312 | $topDir = $this->appConfig['user_data_realdir']; |
| 313 | - $filter = function (\SplFileInfo $file) use ($topDir) { |
|
| 313 | + $filter = function(\SplFileInfo $file) use ($topDir) { |
|
| 314 | 314 | $acceptPath = realpath($topDir); |
| 315 | 315 | $targetPath = $file->getRealPath(); |
| 316 | 316 | return (strpos($targetPath, $acceptPath) === 0); |
@@ -474,7 +474,7 @@ |
||
| 474 | 474 | * |
| 475 | 475 | * @param Application $app |
| 476 | 476 | * @param array $data リクエストパラメータ |
| 477 | - * @return array |
|
| 477 | + * @return \Symfony\Component\Validator\ConstraintViolationListInterface[] |
|
| 478 | 478 | */ |
| 479 | 479 | protected function customerValidation(Application $app, array $data) |
| 480 | 480 | { |
@@ -59,7 +59,6 @@ |
||
| 59 | 59 | protected $app; |
| 60 | 60 | |
| 61 | 61 | /** |
| 62 | - * @param array $config |
|
| 63 | 62 | */ |
| 64 | 63 | public function __construct() |
| 65 | 64 | { |
@@ -48,7 +48,6 @@ |
||
| 48 | 48 | /** |
| 49 | 49 | * SearchProductType constructor. |
| 50 | 50 | * |
| 51 | - * @param Application $app |
|
| 52 | 51 | */ |
| 53 | 52 | public function __construct() |
| 54 | 53 | { |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | * @deprecated 呼び出し元で制御する |
| 50 | 50 | * @param $block_id |
| 51 | 51 | * @param $DeviceType |
| 52 | - * @return array|\Eccube\Entity\Block |
|
| 52 | + * @return Block|null |
|
| 53 | 53 | */ |
| 54 | 54 | public function findOrCreate($block_id, $DeviceType) |
| 55 | 55 | { |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | * ブロック一覧の取得. |
| 112 | 112 | * |
| 113 | 113 | * @param \Eccube\Entity\Master\DeviceType $DeviceType |
| 114 | - * @return array |
|
| 114 | + * @return null|\Symfony\Component\HttpFoundation\Request |
|
| 115 | 115 | */ |
| 116 | 116 | public function getList($DeviceType) |
| 117 | 117 | { |
@@ -197,7 +197,7 @@ |
||
| 197 | 197 | $this->appConfig['block_default_realdir'], |
| 198 | 198 | ); |
| 199 | 199 | foreach ($readPaths as $readPath) { |
| 200 | - $filePath = $readPath . '/' . $fileName . '.twig'; |
|
| 200 | + $filePath = $readPath.'/'.$fileName.'.twig'; |
|
| 201 | 201 | $fs = new Filesystem(); |
| 202 | 202 | if ($fs->exists($filePath)) { |
| 203 | 203 | return array( |