| @@ -230,6 +230,10 @@ discard block | ||
| 230 | 230 | return $str; | 
| 231 | 231 | } | 
| 232 | 232 | |
| 233 | + /** | |
| 234 | + * @param string $topDir | |
| 235 | + * @param Request $request | |
| 236 | + */ | |
| 233 | 237 | private function getTree($topDir, $request) | 
| 234 | 238 |      { | 
| 235 | 239 | $finder = Finder::create()->in($topDir) | 
| @@ -267,6 +271,10 @@ discard block | ||
| 267 | 271 | return $tree; | 
| 268 | 272 | } | 
| 269 | 273 | |
| 274 | + /** | |
| 275 | + * @param Application $app | |
| 276 | + * @param string $nowDir | |
| 277 | + */ | |
| 270 | 278 | private function getFileList($app, $nowDir) | 
| 271 | 279 |      { | 
| 272 | 280 | $topDir = $app['config']['user_data_realdir']; | 
| @@ -326,6 +334,9 @@ discard block | ||
| 326 | 334 | return (strpos($targetDir, $topDir) === 0); | 
| 327 | 335 | } | 
| 328 | 336 | |
| 337 | + /** | |
| 338 | + * @return string | |
| 339 | + */ | |
| 329 | 340 | private function convertStrFromServer($target) | 
| 330 | 341 |      { | 
| 331 | 342 |          if ($this->encode == self::SJIS) { | 
| @@ -39,7 +39,7 @@ discard block | ||
| 39 | 39 | private $error = null; | 
| 40 | 40 | private $encode = ''; | 
| 41 | 41 | |
| 42 | -    public function __construct(){ | |
| 42 | +    public function __construct() { | |
| 43 | 43 | $this->encode = self::UTF; | 
| 44 | 44 |          if ('\\' === DIRECTORY_SEPARATOR) { | 
| 45 | 45 | $this->encode = self::SJIS; | 
| @@ -84,7 +84,7 @@ discard block | ||
| 84 | 84 | $arrFileList = $this->getFileList($app, $nowDir); | 
| 85 | 85 | |
| 86 | 86 | $javascript = $this->getJsArrayList($tree); | 
| 87 | -        $onload = "eccube.fileManager.viewFileTree('tree', arrTree, '" . $nowDir . "', 'tree_select_file', 'tree_status', 'move');"; | |
| 87 | +        $onload = "eccube.fileManager.viewFileTree('tree', arrTree, '".$nowDir."', 'tree_select_file', 'tree_status', 'move');"; | |
| 88 | 88 | |
| 89 | 89 |          return $app->render('Content/file.twig', array( | 
| 90 | 90 | 'form' => $form->createView(), | 
| @@ -141,7 +141,7 @@ discard block | ||
| 141 | 141 |                  $nowDir = $this->checkDir($request->get('now_dir'), $topDir) | 
| 142 | 142 |                      ? $this->normalizePath($request->get('now_dir')) | 
| 143 | 143 | : $topDir; | 
| 144 | - $fs->mkdir($nowDir . '/' . $filename); | |
| 144 | + $fs->mkdir($nowDir.'/'.$filename); | |
| 145 | 145 | } | 
| 146 | 146 | } | 
| 147 | 147 | } | 
| @@ -219,7 +219,7 @@ discard block | ||
| 219 | 219 |      { | 
| 220 | 220 | $str = "arrTree = new Array();\n"; | 
| 221 | 221 |          foreach ($tree as $key => $val) { | 
| 222 | -            $str .= 'arrTree[' . $key . "] = new Array(" . $key . ", '" . $val['type'] . "', '" . $val['path'] . "', " . $val['rank'] . ','; | |
| 222 | +            $str .= 'arrTree['.$key."] = new Array(".$key.", '".$val['type']."', '".$val['path']."', ".$val['rank'].','; | |
| 223 | 223 |              if ($val['open']) { | 
| 224 | 224 | $str .= "true);\n"; | 
| 225 | 225 |              } else { | 
| @@ -270,7 +270,7 @@ discard block | ||
| 270 | 270 | private function getFileList($app, $nowDir) | 
| 271 | 271 |      { | 
| 272 | 272 | $topDir = $app['config']['user_data_realdir']; | 
| 273 | -        $filter = function (\SplFileInfo $file) use ($topDir) { | |
| 273 | +        $filter = function(\SplFileInfo $file) use ($topDir) { | |
| 274 | 274 | $acceptPath = realpath($topDir); | 
| 275 | 275 | $targetPath = $file->getRealPath(); | 
| 276 | 276 | return (strpos($targetPath, $acceptPath) === 0); | 
| @@ -377,7 +377,7 @@ discard block | ||
| 377 | 377 | /** | 
| 378 | 378 | * フォームからの入直内容に基づいて、受注情報の再計算を行う | 
| 379 | 379 | * | 
| 380 | - * @param $app | |
| 380 | + * @param Application $app | |
| 381 | 381 | * @param $Order | 
| 382 | 382 | */ | 
| 383 | 383 | protected function calculate($app, \Eccube\Entity\Order $Order) | 
| @@ -471,7 +471,7 @@ discard block | ||
| 471 | 471 | * - 受注ステータスが入金済に設定された場合に入金日を更新 | 
| 472 | 472 | * | 
| 473 | 473 | * | 
| 474 | - * @param $app | |
| 474 | + * @param Application $app | |
| 475 | 475 | * @param $TargetOrder | 
| 476 | 476 | * @param $OriginOrder | 
| 477 | 477 | */ | 
| @@ -333,7 +333,7 @@ discard block | ||
| 333 | 333 |                  $session->set('eccube.admin.order.customer.search', $searchData); | 
| 334 | 334 |                  $session->set('eccube.admin.order.customer.search.page_no', $page_no); | 
| 335 | 335 |              } else { | 
| 336 | -                $searchData = (array)$session->get('eccube.admin.order.customer.search'); | |
| 336 | +                $searchData = (array) $session->get('eccube.admin.order.customer.search'); | |
| 337 | 337 |                  if (is_null($page_no)) { | 
| 338 | 338 |                      $page_no = intval($session->get('eccube.admin.order.customer.search.page_no')); | 
| 339 | 339 |                  } else { | 
| @@ -489,7 +489,7 @@ discard block | ||
| 489 | 489 |                  $session->set('eccube.admin.order.product.search', $searchData); | 
| 490 | 490 |                  $session->set('eccube.admin.order.product.search.page_no', $page_no); | 
| 491 | 491 |              } else { | 
| 492 | -                $searchData = (array)$session->get('eccube.admin.order.product.search'); | |
| 492 | +                $searchData = (array) $session->get('eccube.admin.order.product.search'); | |
| 493 | 493 |                  if (is_null($page_no)) { | 
| 494 | 494 |                      $page_no = intval($session->get('eccube.admin.order.product.search.page_no')); | 
| 495 | 495 |                  } else { | 
| @@ -259,6 +259,9 @@ | ||
| 259 | 259 | } | 
| 260 | 260 | |
| 261 | 261 | |
| 262 | + /** | |
| 263 | + * @param Application $app | |
| 264 | + */ | |
| 262 | 265 | private function createBody($app, $header, $footer, $Order) | 
| 263 | 266 |      { | 
| 264 | 267 |          return $app->renderView('Mail/order.twig', array( | 
| @@ -336,10 +336,10 @@ | ||
| 336 | 336 | } | 
| 337 | 337 | } | 
| 338 | 338 |          } else { | 
| 339 | -            $filter = function ($v) { | |
| 339 | +            $filter = function($v) { | |
| 340 | 340 |                  return preg_match('/^ids\d+$/', $v); | 
| 341 | 341 | }; | 
| 342 | -            $map = function ($v) { | |
| 342 | +            $map = function($v) { | |
| 343 | 343 |                  return preg_replace('/[^\d+]/', '', $v); | 
| 344 | 344 | }; | 
| 345 | 345 | $keys = array_keys($request->query->all()); | 
| @@ -28,7 +28,6 @@ | ||
| 28 | 28 | use Eccube\Entity\Master\DeviceType; | 
| 29 | 29 | use Eccube\Util\Str; | 
| 30 | 30 | use Symfony\Component\Filesystem\Filesystem; | 
| 31 | -use Symfony\Component\Finder\Finder; | |
| 32 | 31 | use Symfony\Component\Form\FormError; | 
| 33 | 32 | use Symfony\Component\HttpFoundation\Request; | 
| 34 | 33 | use Symfony\Component\HttpFoundation\Response; | 
| @@ -77,7 +77,7 @@ discard block | ||
| 77 | 77 | $config['template_realdir'] = $config['root_dir'].'/app/template/'.$templateCode; | 
| 78 | 78 | $config['template_html_realdir'] = $config['public_path_realdir'].'/template/'.$templateCode; | 
| 79 | 79 | $config['front_urlpath'] = $config['root_urlpath'].RELATIVE_PUBLIC_DIR_PATH.'/template/'.$templateCode; | 
| 80 | - $config['block_realdir'] =$config['template_realdir'].'/Block'; | |
| 80 | + $config['block_realdir'] = $config['template_realdir'].'/Block'; | |
| 81 | 81 | |
| 82 | 82 |                  if (file_exists($file.'.php')) { | 
| 83 | 83 |                      file_put_contents($file.'.php', sprintf('<?php return %s', var_export($config, true)).';'); | 
| @@ -117,19 +117,19 @@ discard block | ||
| 117 | 117 | // 該当テンプレートのディレクトリ | 
| 118 | 118 | $config = $app['config']; | 
| 119 | 119 | $templateCode = $Template->getCode(); | 
| 120 | - $targetRealDir = $config['root_dir'] . '/app/template/' . $templateCode; | |
| 121 | - $targetHtmlRealDir = $config['root_dir'] . '/html/template/' . $templateCode; | |
| 120 | + $targetRealDir = $config['root_dir'].'/app/template/'.$templateCode; | |
| 121 | + $targetHtmlRealDir = $config['root_dir'].'/html/template/'.$templateCode; | |
| 122 | 122 | |
| 123 | 123 | // 一時ディレクトリ | 
| 124 | 124 | $uniqId = sha1(Str::random(32)); | 
| 125 | - $tmpDir = $config['template_temp_realdir'] . '/' . $uniqId; | |
| 126 | - $appDir = $tmpDir . '/app'; | |
| 127 | - $htmlDir = $tmpDir . '/html'; | |
| 125 | + $tmpDir = $config['template_temp_realdir'].'/'.$uniqId; | |
| 126 | + $appDir = $tmpDir.'/app'; | |
| 127 | + $htmlDir = $tmpDir.'/html'; | |
| 128 | 128 | |
| 129 | 129 | // ファイル名 | 
| 130 | - $tarFile = $config['template_temp_realdir'] . '/' . $uniqId . '.tar'; | |
| 131 | - $tarGzFile = $tarFile . '.gz'; | |
| 132 | - $downloadFileName = $Template->getCode() . '.tar.gz'; | |
| 130 | + $tarFile = $config['template_temp_realdir'].'/'.$uniqId.'.tar'; | |
| 131 | + $tarGzFile = $tarFile.'.gz'; | |
| 132 | + $downloadFileName = $Template->getCode().'.tar.gz'; | |
| 133 | 133 | |
| 134 | 134 | // 該当テンプレートを一時ディレクトリへコピーする. | 
| 135 | 135 | $fs = new Filesystem(); | 
| @@ -149,14 +149,14 @@ discard block | ||
| 149 | 149 | |
| 150 | 150 | // ダウンロード完了後にファイルを削除する. | 
| 151 | 151 | // http://stackoverflow.com/questions/15238897/removing-file-after-delivering-response-with-silex-symfony | 
| 152 | - $app->finish(function (Request $request, Response $response, \Silex\Application $app) use ( | |
| 152 | + $app->finish(function(Request $request, Response $response, \Silex\Application $app) use ( | |
| 153 | 153 | $tmpDir, | 
| 154 | 154 | $tarFile, | 
| 155 | 155 | $tarGzFile | 
| 156 | 156 |          ) { | 
| 157 | -            $app['monolog']->addDebug('remove temp file: ' . $tmpDir); | |
| 158 | -            $app['monolog']->addDebug('remove temp file: ' . $tarFile); | |
| 159 | -            $app['monolog']->addDebug('remove temp file: ' . $tarGzFile); | |
| 157 | +            $app['monolog']->addDebug('remove temp file: '.$tmpDir); | |
| 158 | +            $app['monolog']->addDebug('remove temp file: '.$tarFile); | |
| 159 | +            $app['monolog']->addDebug('remove temp file: '.$tarGzFile); | |
| 160 | 160 | $fs = new Filesystem(); | 
| 161 | 161 | $fs->remove($tmpDir); | 
| 162 | 162 | $fs->remove($tarFile); | 
| @@ -197,8 +197,8 @@ discard block | ||
| 197 | 197 | // テンプレートディレクトリの削除 | 
| 198 | 198 | $config = $app['config']; | 
| 199 | 199 | $templateCode = $Template->getCode(); | 
| 200 | - $targetRealDir = $config['root_dir'] . '/app/template/' . $templateCode; | |
| 201 | - $targetHtmlRealDir = $config['root_dir'] . '/html/template/' . $templateCode; | |
| 200 | + $targetRealDir = $config['root_dir'].'/app/template/'.$templateCode; | |
| 201 | + $targetHtmlRealDir = $config['root_dir'].'/html/template/'.$templateCode; | |
| 202 | 202 | |
| 203 | 203 | $fs = new Filesystem(); | 
| 204 | 204 | $fs->remove($targetRealDir); | 
| @@ -241,18 +241,18 @@ discard block | ||
| 241 | 241 | // 該当テンプレートのディレクトリ | 
| 242 | 242 | $config = $app['config']; | 
| 243 | 243 | $templateCode = $Template->getCode(); | 
| 244 | - $targetRealDir = $config['root_dir'] . '/app/template/' . $templateCode; | |
| 245 | - $targetHtmlRealDir = $config['root_dir'] . '/html/template/' . $templateCode; | |
| 244 | + $targetRealDir = $config['root_dir'].'/app/template/'.$templateCode; | |
| 245 | + $targetHtmlRealDir = $config['root_dir'].'/html/template/'.$templateCode; | |
| 246 | 246 | |
| 247 | 247 | // 一時ディレクトリ | 
| 248 | 248 | $uniqId = sha1(Str::random(32)); | 
| 249 | - $tmpDir = $config['template_temp_realdir'] . '/' . $uniqId; | |
| 250 | - $appDir = $tmpDir . '/app'; | |
| 251 | - $htmlDir = $tmpDir . '/html'; | |
| 249 | + $tmpDir = $config['template_temp_realdir'].'/'.$uniqId; | |
| 250 | + $appDir = $tmpDir.'/app'; | |
| 251 | + $htmlDir = $tmpDir.'/html'; | |
| 252 | 252 | |
| 253 | 253 | $formFile = $form['file']->getData(); | 
| 254 | 254 | // ファイル名 | 
| 255 | - $archive = $templateCode . '.' . $formFile->getClientOriginalExtension(); | |
| 255 | + $archive = $templateCode.'.'.$formFile->getClientOriginalExtension(); | |
| 256 | 256 | |
| 257 | 257 | // ファイルを一時ディレクトリへ移動. | 
| 258 | 258 | $formFile->move($tmpDir, $archive); | 
| @@ -261,11 +261,11 @@ discard block | ||
| 261 | 261 |                  try { | 
| 262 | 262 |                      if ($formFile->getClientOriginalExtension() == 'zip') { | 
| 263 | 263 | $zip = new \ZipArchive(); | 
| 264 | - $zip->open($tmpDir . '/' . $archive); | |
| 264 | + $zip->open($tmpDir.'/'.$archive); | |
| 265 | 265 | $zip->extractTo($tmpDir); | 
| 266 | 266 | $zip->close(); | 
| 267 | 267 |                      } else { | 
| 268 | - $phar = new \PharData($tmpDir . '/' . $archive); | |
| 268 | + $phar = new \PharData($tmpDir.'/'.$archive); | |
| 269 | 269 | $phar->extractTo($tmpDir, null, true); | 
| 270 | 270 | } | 
| 271 | 271 |                  } catch (\Exception $e) { | 
| @@ -130,7 +130,7 @@ | ||
| 130 | 130 | /** | 
| 131 | 131 | * @param \Eccube\Entity\Member $Member | 
| 132 | 132 | * | 
| 133 | - * @return void | |
| 133 | + * @return boolean | |
| 134 | 134 | */ | 
| 135 | 135 | public function up(\Eccube\Entity\Member $Member) | 
| 136 | 136 |      { | 
| @@ -65,7 +65,7 @@ | ||
| 65 | 65 | * @param int|null|\Eccube\Entity\ProductClass $ProductClass 商品規格 | 
| 66 | 66 | * @param int|null|\Eccube\Entity\Master\Pref $Pref 都道府県 | 
| 67 | 67 | * @param int|null|\Eccube\Entity\Master\Country $Country 国 | 
| 68 | - * @return \Eccube\Entity\TaxRule 税設定情報 | |
| 68 | + * @return integer 税設定情報 | |
| 69 | 69 | * | 
| 70 | 70 | * @throws NoResultException | 
| 71 | 71 | */ | 
| @@ -23,8 +23,6 @@ | ||
| 23 | 23 | |
| 24 | 24 | namespace Eccube\Service; | 
| 25 | 25 | |
| 26 | -use Eccube\Application; | |
| 27 | - | |
| 28 | 26 | |
| 29 | 27 | /** | 
| 30 | 28 | * Copyright (C) 2012-2014 David de Boer <[email protected]> | 
| @@ -117,9 +117,9 @@ discard block | ||
| 117 | 117 | |
| 118 | 118 | $this->file = $file; | 
| 119 | 119 | $this->file->setFlags( | 
| 120 | - \SplFileObject::READ_CSV | | |
| 121 | - \SplFileObject::SKIP_EMPTY | | |
| 122 | - \SplFileObject::READ_AHEAD | | |
| 120 | + \SplFileObject::READ_CSV| | |
| 121 | + \SplFileObject::SKIP_EMPTY| | |
| 122 | + \SplFileObject::READ_AHEAD| | |
| 123 | 123 | \SplFileObject::DROP_NEW_LINE | 
| 124 | 124 | ); | 
| 125 | 125 | $this->file->setCsvControl( | 
| @@ -362,7 +362,7 @@ discard block | ||
| 362 | 362 |              if ($count > 1) { | 
| 363 | 363 | $incrementedHeaders[] = $header; | 
| 364 | 364 |                  for ($i = 1; $i < $count; $i++) { | 
| 365 | - $incrementedHeaders[] = $header . $i; | |
| 365 | + $incrementedHeaders[] = $header.$i; | |
| 366 | 366 | } | 
| 367 | 367 |              } else { | 
| 368 | 368 | $incrementedHeaders[] = $header; | 
| @@ -413,7 +413,7 @@ discard block | ||
| 413 | 413 |      protected function convertEncodingRows($row) { | 
| 414 | 414 |          if ('\\' === DIRECTORY_SEPARATOR && PHP_VERSION_ID >= 70000) { | 
| 415 | 415 |              foreach ($row as &$col) { | 
| 416 | - $col = mb_convert_encoding($col , 'UTF-8', 'SJIS-win'); | |
| 416 | + $col = mb_convert_encoding($col, 'UTF-8', 'SJIS-win'); | |
| 417 | 417 | } | 
| 418 | 418 | } | 
| 419 | 419 | return $row; | 
| @@ -137,7 +137,7 @@ | ||
| 137 | 137 | * 仮受注情報作成 | 
| 138 | 138 | * | 
| 139 | 139 | * @param $Customer | 
| 140 | - * @param $preOrderId | |
| 140 | + * @param string $preOrderId | |
| 141 | 141 | * @return mixed | 
| 142 | 142 | * @throws \Doctrine\ORM\NoResultException | 
| 143 | 143 | * @throws \Doctrine\ORM\NonUniqueResultException | 
| @@ -920,7 +920,7 @@ | ||
| 920 | 920 | |
| 921 | 921 | // 配送日数が設定されている | 
| 922 | 922 |          if ($deliveryDateFlag) { | 
| 923 | - $period = new \DatePeriod ( | |
| 923 | + $period = new \DatePeriod( | |
| 924 | 924 | new \DateTime($minDate.' day'), | 
| 925 | 925 |                  new \DateInterval('P1D'), | 
| 926 | 926 | new \DateTime($minDate + $this->app['config']['deliv_date_end_max'].' day') | 
| @@ -58,7 +58,7 @@ | ||
| 58 | 58 | |
| 59 | 59 | // load config dev | 
| 60 | 60 | $conf = $app['config']; | 
| 61 | -$app['config'] = $app->share(function () use ($conf) { | |
| 61 | +$app['config'] = $app->share(function() use ($conf) { | |
| 62 | 62 | $confarray = array(); | 
| 63 | 63 | $config_dev_file = __DIR__.'/../app/config/eccube/config_dev.yml'; | 
| 64 | 64 |      if (file_exists($config_dev_file)) { |