Skip to content

Commit

Permalink
Apply vendor/bin/php-cs-fixer fix src
Browse files Browse the repository at this point in the history
  • Loading branch information
nanasess committed Jul 22, 2022
1 parent ad35a22 commit d95318d
Show file tree
Hide file tree
Showing 100 changed files with 483 additions and 471 deletions.
8 changes: 4 additions & 4 deletions src/Eccube/Common/Constant.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ class Constant
/**
* EC-CUBE VERSION.
*/
const VERSION = '4.2.0-beta';
public const VERSION = '4.2.0-beta';

/**
* Enable value.
*/
const ENABLED = 1;
public const ENABLED = 1;

/**
* Disable value.
*/
const DISABLED = 0;
public const DISABLED = 0;

/**
* Csrf Token Name.
*/
const TOKEN_NAME = '_token';
public const TOKEN_NAME = '_token';
}
5 changes: 2 additions & 3 deletions src/Eccube/Controller/Admin/Content/FileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,15 @@
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\ResponseHeaderBag;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpKernel\Exception\UnsupportedMediaTypeHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Validator\Constraints as Assert;

class FileController extends AbstractController
{
const SJIS = 'sjis-win';
const UTF = 'UTF-8';
public const SJIS = 'sjis-win';
public const UTF = 'UTF-8';
private $errors = [];
private $encode = '';

Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Controller/Admin/Content/LayoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

class LayoutController extends AbstractController
{
const DUMMY_BLOCK_ID = 9999999999;
public const DUMMY_BLOCK_ID = 9999999999;

/**
* @var BlockRepository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public function disableMaintenance(Request $request, $mode, SystemService $syste
} else {
$maintenanceMode = [
'auto_maintenance' => SystemService::AUTO_MAINTENANCE,
'auto_maintenance_update' => SystemService::AUTO_MAINTENANCE_UPDATE
'auto_maintenance_update' => SystemService::AUTO_MAINTENANCE_UPDATE,
];
$systemService->disableMaintenance($maintenanceMode[$mode]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public function export(Request $request)
$ExportCsvRow->pushData();
}

//$row[] = number_format(memory_get_usage(true));
// $row[] = number_format(memory_get_usage(true));
// 出力.
$csvService->fputcsv($ExportCsvRow->getRow());
});
Expand Down
2 changes: 0 additions & 2 deletions src/Eccube/Controller/Admin/Order/MailController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
use Eccube\Service\MailService;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\Routing\Annotation\Route;
use Twig\Environment;

Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Controller/Admin/Order/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ protected function exportCsv(Request $request, $csvTypeId, $fileName)
$ExportCsvRow->pushData();
}

//$row[] = number_format(memory_get_usage(true));
// $row[] = number_format(memory_get_usage(true));
// 出力.
$csvService->fputcsv($ExportCsvRow->getRow());
}
Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Controller/Admin/Product/CategoryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public function export(Request $request)
$ExportCsvRow->pushData();
}

//$row[] = number_format(memory_get_usage(true));
// $row[] = number_format(memory_get_usage(true));
// 出力.
$csvService->fputcsv($ExportCsvRow->getRow());
});
Expand Down
6 changes: 3 additions & 3 deletions src/Eccube/Controller/Admin/Product/CsvImportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ public function csvProduct(Request $request, CacheUtil $cacheUtil)
// 商品カテゴリ登録
$this->createProductCategory($row, $Product, $data, $headerByKey);

//タグ登録
// タグ登録
$this->createProductTag($row, $Product, $data, $headerByKey);

// 商品規格が存在しなければ新規登録
Expand Down Expand Up @@ -1359,7 +1359,7 @@ protected function updateProductClass($row, Product $Product, ProductClass $Prod
if (isset($row[$headerByKey['price01']])) {
if ($row[$headerByKey['price01']] != '') {
$price01 = str_replace(',', '', $row[$headerByKey['price01']]);
$errors = $this->validator->validate($price01, new GreaterThanOrEqual(['value' => 0]));
$errors = $this->validator->validate($price01, new GreaterThanOrEqual(['value' => 0]));
if ($errors->count() === 0) {
$ProductClass->setPrice01($price01);
} else {
Expand Down Expand Up @@ -1639,7 +1639,7 @@ public function splitCsv(Request $request)
// stream filter を適用して文字エンコーディングと改行コードの変換を行う
// see https://github.com/EC-CUBE/ec-cube/issues/5252
$filters = [
ConvertLineFeedFilter::class
ConvertLineFeedFilter::class,
];

if (!\mb_check_encoding($file->current(), 'UTF-8')) {
Expand Down
5 changes: 2 additions & 3 deletions src/Eccube/Controller/Admin/Product/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
Expand Down Expand Up @@ -332,7 +331,7 @@ public function imageProcess(Request $request)
if (count($images) > 0) {
foreach ($images as $img) {
foreach ($img as $image) {
//ファイルフォーマット検証
// ファイルフォーマット検証
$mimeType = $image->getMimeType();
if (0 !== strpos($mimeType, 'image')) {
throw new UnsupportedMediaTypeHttpException();
Expand Down Expand Up @@ -378,7 +377,7 @@ public function imageLoad(Request $request)

$dirs = [
$this->eccubeConfig['eccube_save_image_dir'],
$this->eccubeConfig['eccube_temp_image_dir']
$this->eccubeConfig['eccube_temp_image_dir'],
];

foreach ($dirs as $dir) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function imageProcess(Request $request)
if (isset($images['payment_image_file'])) {
$image = $images['payment_image_file'];

//ファイルフォーマット検証
// ファイルフォーマット検証
$mimeType = $image->getMimeType();
if (0 !== strpos($mimeType, 'image')) {
throw new UnsupportedMediaTypeHttpException();
Expand Down Expand Up @@ -221,7 +221,7 @@ public function imageLoad(Request $request)

$dirs = [
$this->eccubeConfig['eccube_save_image_dir'],
$this->eccubeConfig['eccube_temp_image_dir']
$this->eccubeConfig['eccube_temp_image_dir'],
];

foreach ($dirs as $dir) {
Expand Down
20 changes: 14 additions & 6 deletions src/Eccube/Controller/Admin/Setting/Shop/TradeLawController.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
<?php

/*
* This file is part of EC-CUBE
*
* Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
*
* http://www.ec-cube.co.jp/
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Eccube\Controller\Admin\Setting\Shop;

use Eccube\Controller\AbstractController;
use Eccube\Event\EccubeEvents;
use Eccube\Event\EventArgs;
use Eccube\Form\Type\Admin\OrderStatusSettingType;
use Eccube\Form\Type\Admin\TradeLawType;
use Eccube\Form\Type\Front\ForgotType;
use Eccube\Repository\TradeLawRepository;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Symfony\Component\Form\Extension\Core\Type\CollectionType;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route;

class TradeLawController extends AbstractController
{
Expand All @@ -32,6 +41,7 @@ public function __construct(
*
* @Route("/%eccube_admin_route%/setting/shop/tradelaw", name="admin_setting_shop_tradelaw", methods={"GET", "POST"})
* @Template("@admin/Setting/Shop/tradelaw.twig")
*
* @param Request $request
*/
public function index(Request $request)
Expand All @@ -57,8 +67,6 @@ public function index(Request $request)
$request
);



$form = $builder->getForm();
$form->handleRequest($request);

Expand All @@ -80,7 +88,7 @@ public function index(Request $request)

return [
'form' => $form->createView(),
'tradeLawDetails' => $tradeLawDetails
'tradeLawDetails' => $tradeLawDetails,
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ public function __construct(
EncoderFactoryInterface $encoderFactory,
MemberRepository $memberRepository,
TokenStorageInterface $tokenStorage
)
{
) {
$this->encoderFactory = $encoderFactory;
$this->memberRepository = $memberRepository;
$this->tokenStorage = $tokenStorage;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function index(Request $request, CacheUtil $cacheUtil)
$form->handleRequest($request);

if ($form->isSubmitted() && $form->isValid()) {
//.envファイルが存在しないときに設定は失敗する
// .envファイルが存在しないときに設定は失敗する
if (file_exists($this->getParameter('kernel.project_dir').'/.env') === false) {
$this->addError('admin.common.save_error', 'admin');

Expand All @@ -75,7 +75,7 @@ public function index(Request $request, CacheUtil $cacheUtil)
$env = StringUtil::replaceOrAddEnv($env, [
'ECCUBE_ADMIN_ALLOW_HOSTS' => "'{$adminAllowHosts}'",
'ECCUBE_ADMIN_DENY_HOSTS' => "'{$adminDenyHosts}'",
'ECCUBE_FORCE_SSL' => $data['force_ssl'] ? '1' : '0',
'ECCUBE_FORCE_SSL' => $data['force_ssl'] ? '1' : '0',
'TRUSTED_HOSTS' => $data['trusted_hosts'],
]);

Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Controller/Admin/Store/PluginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ protected function getUnregisteredPlugins(array $plugins)
try {
$this->pluginService->checkPluginArchiveContent($dir->getRealPath());
} catch (PluginException $e) {
//config.yamlに不備があった際は全てスキップ
// config.yamlに不備があった際は全てスキップ
log_warning($e->getMessage());
continue;
}
Expand Down
4 changes: 3 additions & 1 deletion src/Eccube/Controller/EntryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function index(Request $request)
'Status' => [
CustomerStatus::PROVISIONAL,
CustomerStatus::REGULAR,
]
],
]);

if ($existCustomer) {
Expand Down Expand Up @@ -350,6 +350,7 @@ private function getQuantityInCart(): int
*
* @param Customer $Customer
* @param Request $request
*
* @return void
*/
private function doLogin(Customer $Customer, Request $request): void
Expand All @@ -363,6 +364,7 @@ private function doLogin(Customer $Customer, Request $request): void
* 本会員へ更新する.
*
* @param Customer $Customer
*
* @return void
*/
private function updateRegularCustomer(Customer $Customer): void
Expand Down
6 changes: 2 additions & 4 deletions src/Eccube/Controller/Install/InstallController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
namespace Eccube\Controller\Install;

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\CachedReader;
use Doctrine\Common\Cache\ArrayCache;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Types\Type;
Expand Down Expand Up @@ -48,10 +46,10 @@ class InstallController extends AbstractController
/**
* default value of auth magic
*/
const DEFAULT_AUTH_MAGIC = '<change.me>';
public const DEFAULT_AUTH_MAGIC = '<change.me>';

/** @var string */
const TRANSACTION_CHECK_FILE = '/var/.httransaction';
public const TRANSACTION_CHECK_FILE = '/var/.httransaction';

protected $requiredModules = [
'pdo',
Expand Down
2 changes: 0 additions & 2 deletions src/Eccube/Controller/ProductController.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
use Eccube\Event\EccubeEvents;
use Eccube\Event\EventArgs;
use Eccube\Form\Type\AddCartType;
use Eccube\Form\Type\Master\ProductListMaxType;
use Eccube\Form\Type\Master\ProductListOrderByType;
use Eccube\Form\Type\SearchProductType;
use Eccube\Repository\BaseInfoRepository;
use Eccube\Repository\CustomerFavoriteProductRepository;
Expand Down
10 changes: 5 additions & 5 deletions src/Eccube/Controller/ShoppingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function index(PurchaseFlow $cartPurchaseFlow)
return [
'form' => $form->createView(),
'Order' => $Order,
'activeTradeLaws' => $activeTradeLaws
'activeTradeLaws' => $activeTradeLaws,
];
}

Expand Down Expand Up @@ -248,7 +248,7 @@ public function redirectTo(Request $request, RouterInterface $router)
return [
'form' => $form->createView(),
'Order' => $Order,
'activeTradeLaws' => $activeTradeLaws
'activeTradeLaws' => $activeTradeLaws,
];
}

Expand Down Expand Up @@ -326,22 +326,22 @@ public function confirm(Request $request)
return [
'form' => $form->createView(),
'Order' => $Order,
'activeTradeLaws' => $activeTradeLaws
'activeTradeLaws' => $activeTradeLaws,
];
}

log_info('[注文確認] フォームエラーのため, 注文手続画面を表示します.', [$Order->getId()]);

$template = new Template([
'owner' => [$this, 'confirm'],
'template' => 'Shopping/index.twig'
'template' => 'Shopping/index.twig',
]);
$request->attributes->set('_template', $template);

return [
'form' => $form->createView(),
'Order' => $Order,
'activeTradeLaws' => $activeTradeLaws
'activeTradeLaws' => $activeTradeLaws,
];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Controller/SitemapController.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public function page()
private function outputXml(array $data, $template_name = 'sitemap.xml.twig')
{
$response = new Response();
$response->headers->set('Content-Type', 'application/xml'); //Content-Typeを設定
$response->headers->set('Content-Type', 'application/xml'); // Content-Typeを設定

return $this->render(
$template_name,
Expand Down
2 changes: 1 addition & 1 deletion src/Eccube/Controller/TradeLawController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function index()
$tradelaws = $this->tradeLawRepository->findBy([], ['sortNo' => 'ASC']);

return [
'tradelaws' => $tradelaws
'tradelaws' => $tradelaws,
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

class NavCompilerPass implements CompilerPassInterface
{
const NAV_TAG = 'eccube.nav';
public const NAV_TAG = 'eccube.nav';

public function process(ContainerBuilder $container)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

class PaymentMethodPass implements CompilerPassInterface
{
const PAYMENT_METHOD_TAG = 'eccube.payment.method';
public const PAYMENT_METHOD_TAG = 'eccube.payment.method';

public function process(ContainerBuilder $container)
{
Expand Down
Loading

0 comments on commit d95318d

Please sign in to comment.