Skip to content

Commit

Permalink
trailing_comma_in_multiline => false は削除
Browse files Browse the repository at this point in the history
`, ]` となる箇所は別途修正する
see #996 (comment)
  • Loading branch information
nanasess committed Oct 2, 2024
1 parent da8ad32 commit 20138d0
Show file tree
Hide file tree
Showing 182 changed files with 750 additions and 751 deletions.
1 change: 0 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
'no_superfluous_phpdoc_tags' => false, // 副作用があるため
'increment_style' => false, // 強制しなくて良い
'yoda_style' => false, // 強制しなくて良い
'trailing_comma_in_multiline' => false, // `, ]` となるケースを防ぐため

// @Symfony:risky のうち、以下のルールを無効化
'psr_autoloading' => false, // PSR-4 に準拠していないため
Expand Down
2 changes: 1 addition & 1 deletion data/class/SC_CartSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ public function setPrevURL($url, $excludePaths = [])
{
// 前頁として記録しないページを指定する。
$arrExclude = [
'/shopping/'
'/shopping/',
];
$arrExclude = array_merge($arrExclude, $excludePaths);
$exclude = false;
Expand Down
2 changes: 1 addition & 1 deletion data/class/SC_Fpdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function __construct($download, $title, $tpl_pdf = 'nouhinsyo1.pdf')
$this->arrMessage = [
'このたびはお買上げいただきありがとうございます。',
'下記の内容にて納品させていただきます。',
'ご確認くださいますよう、お願いいたします。'
'ご確認くださいますよう、お願いいたします。',
];

// SJISフォント
Expand Down
2 changes: 1 addition & 1 deletion data/class/SC_Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ public static function sendHttpStatus($statusCode)
503 => 'Service Unavailable', // サービス利用不可
504 => 'Gateway Timeout', // ゲートウェイタイムアウト
505 => 'HTTP Version Not Supported', // サポートしていないHTTPバージョン
509 => 'Bandwidth Limit Exceeded' // 帯域幅制限超過
509 => 'Bandwidth Limit Exceeded', // 帯域幅制限超過
];
if (isset($messages[$statusCode])) {
if ($httpVersion !== '1.1') {
Expand Down
4 changes: 2 additions & 2 deletions data/class/SC_SendMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public function setHost($host)
$this->host = $host;
$arrHost = [
'host' => $this->host,
'port' => $this->port
'port' => $this->port,
];
// PEAR::Mailを使ってメール送信オブジェクト作成
$this->objMail = &Mail::factory('smtp', $arrHost);
Expand All @@ -185,7 +185,7 @@ public function setPort($port)
$this->port = $port;
$arrHost = [
'host' => $this->host,
'port' => $this->port
'port' => $this->port,
];
// PEAR::Mailを使ってメール送信オブジェクト作成
$this->objMail = &Mail::factory('smtp', $arrHost);
Expand Down
10 changes: 5 additions & 5 deletions data/class/api/SC_Api_Operation.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,8 @@ public static function doApiAction($arrPost)
// 実行成功
$arrResponseValidSection = ['Request' => [
'IsValid' => 'True',
$operation_name.'Request' => $arrOperationRequestValid
]
$operation_name.'Request' => $arrOperationRequestValid,

Check warning on line 372 in data/class/api/SC_Api_Operation.php

View check run for this annotation

Codecov / codecov/patch

data/class/api/SC_Api_Operation.php#L372

Added line #L372 was not covered by tests
],
];
$response_outer = $operation_name.'Response';

Check warning on line 375 in data/class/api/SC_Api_Operation.php

View check run for this annotation

Codecov / codecov/patch

data/class/api/SC_Api_Operation.php#L375

Added line #L375 was not covered by tests
SC_Api_Utils_Ex::printApiLog('Operation SUCCESS', $start_time, $response_outer);
Expand All @@ -382,8 +382,8 @@ public static function doApiAction($arrPost)
}
$arrResponseValidSection = ['Request' => [
'IsValid' => 'False',
'Errors' => ['Error' => $arrResponseErrorSection]
]
'Errors' => ['Error' => $arrResponseErrorSection],

Check warning on line 385 in data/class/api/SC_Api_Operation.php

View check run for this annotation

Codecov / codecov/patch

data/class/api/SC_Api_Operation.php#L385

Added line #L385 was not covered by tests
],
];
if (is_object($objApiOperation)) {
$response_outer = $operation_name.'Response';

Check warning on line 389 in data/class/api/SC_Api_Operation.php

View check run for this annotation

Codecov / codecov/patch

data/class/api/SC_Api_Operation.php#L389

Added line #L389 was not covered by tests
Expand Down Expand Up @@ -416,7 +416,7 @@ protected static function getOperationRequestEcho($arrParam, $start_time)
{
$arrRet = [
'HTTPHeaders' => ['Header' => ['_attributes' => ['Name' => 'UserAgent',
'Value' => htmlspecialchars($_SERVER['HTTP_USER_AGENT'])]]],
'Value' => htmlspecialchars($_SERVER['HTTP_USER_AGENT']), ]]],

Check warning on line 419 in data/class/api/SC_Api_Operation.php

View check run for this annotation

Codecov / codecov/patch

data/class/api/SC_Api_Operation.php#L418-L419

Added lines #L418 - L419 were not covered by tests
'RequestId' => $start_time,
'Arguments' => [],
];
Expand Down
4 changes: 2 additions & 2 deletions data/class/api/SC_Api_Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ public static function sendResponseXml($response_outer_name, &$arrResponse)
'encoding' => 'UTF-8',
'rootName' => $response_outer_name,
'rootAttributes' => ['xmlns' => self::API_XMLNS.ECCUBE_VERSION,

Check warning on line 237 in data/class/api/SC_Api_Utils.php

View check run for this annotation

Codecov / codecov/patch

data/class/api/SC_Api_Utils.php#L237

Added line #L237 was not covered by tests
'xml:lang' => self::API_XML_LANG],
'xml:lang' => self::API_XML_LANG, ],
'defaultTagName' => 'Response',
'attributesArray' => '_attributes'
'attributesArray' => '_attributes',

Check warning on line 240 in data/class/api/SC_Api_Utils.php

View check run for this annotation

Codecov / codecov/patch

data/class/api/SC_Api_Utils.php#L240

Added line #L240 was not covered by tests
];

$objSerializer = new XML_Serializer($options);
Expand Down
6 changes: 3 additions & 3 deletions data/class/api/operations/BrowseNodeLookup.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ public function doAction($arrParam)
'BrowseNodeId' => $category_id,
'Name' => $arrCategory['category_name'],
'PageURL' => HTTP_URL.'products/list.php?category_id='.$arrCategory['category_id'],
'has_children' => count($arrChildren) > 0
'has_children' => count($arrChildren) > 0,

Check warning on line 75 in data/class/api/operations/BrowseNodeLookup.php

View check run for this annotation

Codecov / codecov/patch

data/class/api/operations/BrowseNodeLookup.php#L74-L75

Added lines #L74 - L75 were not covered by tests
];
} else {
$arrData = [
'BrowseNodeId' => $category_id,
'Name' => 'ホーム',
'PageURL' => HTTP_URL,
'has_children' => count($arrChildren) > 0
'has_children' => count($arrChildren) > 0,

Check warning on line 82 in data/class/api/operations/BrowseNodeLookup.php

View check run for this annotation

Codecov / codecov/patch

data/class/api/operations/BrowseNodeLookup.php#L81-L82

Added lines #L81 - L82 were not covered by tests
];
}

Expand All @@ -90,7 +90,7 @@ public function doAction($arrParam)
'BrowseNodeId' => $category['category_id'],
'Name' => $category['category_name'],
'PageURL' => HTTP_URL.'products/list.php?category_id='.$category['category_id'],
'has_children' => $category['has_children']
'has_children' => $category['has_children'],

Check warning on line 93 in data/class/api/operations/BrowseNodeLookup.php

View check run for this annotation

Codecov / codecov/patch

data/class/api/operations/BrowseNodeLookup.php#L92-L93

Added lines #L92 - L93 were not covered by tests
];
}
}
Expand Down
2 changes: 1 addition & 1 deletion data/class/api/operations/CartAdd.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class API_CartAdd extends SC_Api_Abstract_Ex
public function doAction($arrParam)
{
$this->arrResponse = [
'Version' => ECCUBE_VERSION];
'Version' => ECCUBE_VERSION, ];

Check warning on line 43 in data/class/api/operations/CartAdd.php

View check run for this annotation

Codecov / codecov/patch

data/class/api/operations/CartAdd.php#L42-L43

Added lines #L42 - L43 were not covered by tests

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion data/class/api/operations/CartClear.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class API_CartClear extends SC_Api_Abstract_Ex
public function doAction($arrParam)
{
$this->arrResponse = [
'Version' => ECCUBE_VERSION];
'Version' => ECCUBE_VERSION, ];

Check warning on line 43 in data/class/api/operations/CartClear.php

View check run for this annotation

Codecov / codecov/patch

data/class/api/operations/CartClear.php#L42-L43

Added lines #L42 - L43 were not covered by tests

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion data/class/api/operations/CartCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class API_CartCreate extends SC_Api_Abstract_Ex
public function doAction($arrParam)
{
$this->arrResponse = [
'Version' => ECCUBE_VERSION];
'Version' => ECCUBE_VERSION, ];

Check warning on line 43 in data/class/api/operations/CartCreate.php

View check run for this annotation

Codecov / codecov/patch

data/class/api/operations/CartCreate.php#L42-L43

Added lines #L42 - L43 were not covered by tests

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion data/class/api/operations/CartGet.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class API_CartGet extends SC_Api_Abstract_Ex
public function doAction($arrParam)
{
$this->arrResponse = [
'Version' => ECCUBE_VERSION];
'Version' => ECCUBE_VERSION, ];

Check warning on line 43 in data/class/api/operations/CartGet.php

View check run for this annotation

Codecov / codecov/patch

data/class/api/operations/CartGet.php#L42-L43

Added lines #L42 - L43 were not covered by tests

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion data/class/api/operations/CartModify.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class API_CartModify extends SC_Api_Abstract_Ex
public function doAction($arrParam)
{
$this->arrResponse = [
'Version' => ECCUBE_VERSION];
'Version' => ECCUBE_VERSION, ];

Check warning on line 43 in data/class/api/operations/CartModify.php

View check run for this annotation

Codecov / codecov/patch

data/class/api/operations/CartModify.php#L42-L43

Added lines #L42 - L43 were not covered by tests

return true;
}
Expand Down
2 changes: 1 addition & 1 deletion data/class/api/operations/GetVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class API_GetVersion extends SC_Api_Abstract_Ex
public function doAction($arrParam)
{
$this->arrResponse = [
'Version' => ECCUBE_VERSION];
'Version' => ECCUBE_VERSION, ];

Check warning on line 44 in data/class/api/operations/GetVersion.php

View check run for this annotation

Codecov / codecov/patch

data/class/api/operations/GetVersion.php#L42-L44

Added lines #L42 - L44 were not covered by tests
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions data/class/api/operations/ItemSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function doAction($arrParam)
$arrData[] = [

Check warning on line 75 in data/class/api/operations/ItemSearch.php

View check run for this annotation

Codecov / codecov/patch

data/class/api/operations/ItemSearch.php#L75

Added line #L75 was not covered by tests
'product_id' => $val['product_id'],
'DetailPageURL' => HTTP_URL.'products/detail.php?product_id='.$val['product_id'],
'ItemAttributes' => $val
'ItemAttributes' => $val,

Check warning on line 78 in data/class/api/operations/ItemSearch.php

View check run for this annotation

Codecov / codecov/patch

data/class/api/operations/ItemSearch.php#L77-L78

Added lines #L77 - L78 were not covered by tests
];
}
$this->setResponse('Item', $arrData);
Expand Down Expand Up @@ -188,7 +188,7 @@ protected function getSearchCondition($arrSearchData)
'arrval' => [],
'where_category' => '',
'arrvalCategory' => [],
'orderby' => ''
'orderby' => '',
];

// カテゴリからのWHERE文字列取得
Expand Down
2 changes: 1 addition & 1 deletion data/class/batch/SC_Batch_Update.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function execute($target = '.')
$arrLog = [
'err' => [],
'ok' => [],
'buckup_path' => $bkupPath
'buckup_path' => $bkupPath,
];

if (!is_writable($bkupPath) || !is_writable($bkupPathFile)) {
Expand Down
2 changes: 1 addition & 1 deletion data/class/db/SC_DB_DBFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function getDSN($dsn = '')
'protocol' => 'tcp',
'hostspec' => DB_SERVER,
'port' => DB_PORT,
'database' => DB_NAME
'database' => DB_NAME,
];
} else {
return '';
Expand Down
2 changes: 1 addition & 1 deletion data/class/db/SC_DB_MasterData.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public function registMasterData($name, $columns, $masterData, $autoCommit = tru
foreach ($masterData as $key => $val) {
$sqlVal = [$columns[0] => (string) $key,
$columns[1] => (string) $val,
$columns[2] => (string) $i];
$columns[2] => (string) $i, ];
$this->objQuery->insert($name, $sqlVal);
$i++;
}
Expand Down
4 changes: 2 additions & 2 deletions data/class/helper/SC_Helper_DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ public function addProductBeforCategories($category_id, $product_id)
$objQuery = SC_Query_Ex::getSingletonInstance();

$sqlval = ['category_id' => $category_id,
'product_id' => $product_id];
'product_id' => $product_id, ];

$arrSql = [];
$arrSql['rank'] = '(SELECT COALESCE(MAX(rank), 0) FROM dtb_product_categories sub WHERE category_id = ?) + 1';
Expand All @@ -707,7 +707,7 @@ public function addProductBeforCategories($category_id, $product_id)
public function addProductAfterCategories($category_id, $product_id)
{
$sqlval = ['category_id' => $category_id,
'product_id' => $product_id];
'product_id' => $product_id, ];

$objQuery = SC_Query_Ex::getSingletonInstance();

Expand Down
2 changes: 1 addition & 1 deletion data/class/helper/SC_Helper_Mobile.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class SC_Helper_Mobile
'zip' => 'application/zip',
'doc' => 'application/msword',
'xls' => 'application/vnd.ms-excel',
'ppt' => 'application/vnd.ms-powerpoint'
'ppt' => 'application/vnd.ms-powerpoint',
];

/**
Expand Down
2 changes: 1 addition & 1 deletion data/class/helper/SC_Helper_Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ public function setHeadNaviBlocs(&$arrBlocs)
foreach ($this->arrHeadNaviBlocsByPlugin as $key => $value) {
$arrBlocs[] = [
'target_id' => $value,
'php_path' => $key
'php_path' => $key,

Check warning on line 314 in data/class/helper/SC_Helper_Plugin.php

View check run for this annotation

Codecov / codecov/patch

data/class/helper/SC_Helper_Plugin.php#L312-L314

Added lines #L312 - L314 were not covered by tests
];
}
}
Expand Down
2 changes: 1 addition & 1 deletion data/class/helper/SC_Helper_Purchase.php
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ public function registerOrderComplete($orderParams, &$objCartSession, $cartKey)
// 不要な変数を unset
$unsets = [
'mailmaga_flg', 'deliv_check', 'point_check', 'password',
'reminder', 'reminder_answer', 'mail_flag', 'session'
'reminder', 'reminder_answer', 'mail_flag', 'session',
];
foreach ($unsets as $unset) {
unset($orderParams[$unset]);
Expand Down
2 changes: 1 addition & 1 deletion data/class/helper/SC_Helper_TaxRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public static function getTaxRule($product_id = 0, $product_class_id = 0, $pref_
$arrRequest = ['product_id' => $product_id,
'product_class_id' => $product_class_id,
'pref_id' => $pref_id,
'country_id' => $country_id];
'country_id' => $country_id, ];

// 地域設定を優先するが、システムパラメーターなどに設定を持っていくか
// 後に書いてあるほど優先される、詳細後述MEMO参照
Expand Down
2 changes: 1 addition & 1 deletion data/class/helper/SC_Helper_Transform.php
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ protected function lfSetError($selector, $type, $err_msg = null)
$this->arrErr[] = [
'selector' => $selector,
'type' => $type,
'err_msg' => $err_msg
'err_msg' => $err_msg,

Check warning on line 713 in data/class/helper/SC_Helper_Transform.php

View check run for this annotation

Codecov / codecov/patch

data/class/helper/SC_Helper_Transform.php#L710-L713

Added lines #L710 - L713 were not covered by tests
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public function getProduct($product_id)
$return = [
'product_id' => $arrProduct['product_id'],
'main_list_image' => $arrProduct['main_list_image'],
'name' => $arrProduct['name']
'name' => $arrProduct['name'],
];

return $return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ public function createWhere(&$objFormParam, &$objDb)

return [
'where' => $where,
'bind' => $bind
'bind' => $bind,
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public function action()
$objLayout->lfDelPageData($this->page_id, $this->device_type_id);

SC_Response_Ex::reload(['device_type_id' => $this->device_type_id,
'msg' => 'on'], true);
'msg' => 'on', ], true);
SC_Response_Ex::actionExit();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function lfCheckError(&$objFormParam, &$objUpFile)
$arrIgnoreCode = ['admin',
MOBILE_DEFAULT_TEMPLATE_NAME,
SMARTPHONE_DEFAULT_TEMPLATE_NAME,
DEFAULT_TEMPLATE_NAME];
DEFAULT_TEMPLATE_NAME, ];
if (in_array($template_code, $arrIgnoreCode)) {
$arrErr['template_code'] = '※ このテンプレートコードは使用できません。<br/>';
}
Expand Down
10 changes: 5 additions & 5 deletions data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class LC_Page_Admin_Order_Edit extends LC_Page_Admin_Order_Ex
'quantity',
'price',
'tax_rate',
'tax_rule'
'tax_rule',
];

/**
Expand Down Expand Up @@ -508,7 +508,7 @@ public function setMultipleItemTo(&$objFormParam)
'multiple_classcategory_name1',
'multiple_classcategory_name2',
'multiple_price',
'multiple_quantity'];
'multiple_quantity', ];
$arrMultipleParams = $objFormParam->getSwapArray($arrMultipleKey);

/*
Expand Down Expand Up @@ -684,7 +684,7 @@ public function lfCheckError(&$objFormParam)
$day = $arrValues['shipping_date_day'][$key_index];
$objError = new SC_CheckError_Ex(['shipping_date_year' => $year,
'shipping_date_month' => $month,
'shipping_date_day' => $day]);
'shipping_date_day' => $day, ]);
$objError->doFunc(['お届け日', 'shipping_date_year', 'shipping_date_month', 'shipping_date_day'], ['CHECK_DATE']);
$arrErrDate['shipping_date_year'][$key_index] = $objError->arrErr['shipping_date_year'];
}
Expand All @@ -696,7 +696,7 @@ public function lfCheckError(&$objFormParam)
$day = $arrValues['order_birth_day'];
$objError = new SC_CheckError_Ex(['order_birth_year' => $year,
'order_birth_month' => $month,
'order_birth_day' => $day]);
'order_birth_day' => $day, ]);
$objError->doFunc(['生年月日', 'order_birth_year', 'order_birth_month', 'order_birth_day'],
['CHECK_BIRTHDAY']);
$arrErrTemp['order_birth_year'] = $objError->arrErr['order_birth_year'];
Expand Down Expand Up @@ -811,7 +811,7 @@ public function doRegister($order_id, &$objPurchase, &$objFormParam, &$message,
'classcategory_name1',
'classcategory_name2',
'tax_rate',
'tax_rule'
'tax_rule',
]);

// 変更しようとしている商品情報とDBに登録してある商品情報を比較することで、更新すべき数量を計算
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1053,7 +1053,7 @@ public function lfRegistProduct(&$objUpFile, &$objDownFile, $arrList)
'main_list_comment', 'main_comment',
'deliv_fee', 'comment1', 'comment2', 'comment3',
'comment4', 'comment5', 'comment6',
'sale_limit', 'deliv_date_id', 'maker_id', 'note'];
'sale_limit', 'deliv_date_id', 'maker_id', 'note', ];
$arrList = SC_Utils_Ex::arrayDefineIndexes($arrList, $checkArray);

// INSERTする値を作成する。
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ public function doPreEdit(&$objFormParam)
$arrKeys = ['classcategory_id1', 'classcategory_id2', 'product_code',
'classcategory_name1', 'classcategory_name2', 'stock',
'stock_unlimited', 'price01', 'price02',
'product_type_id', 'down_filename', 'down_realfilename', 'upload_index', 'tax_rate'
'product_type_id', 'down_filename', 'down_realfilename', 'upload_index', 'tax_rate',
];
$arrFormValues = $objFormParam->getSwapArray($arrKeys);
// フォームの規格1, 規格2をキーにした配列を生成
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ public function lfCheckErrorDetail($item, $arrErr)
$where,
[$parent_category_id,
$item['category_id'],
$item['category_name']]);
$item['category_name'], ]);
if ($exists) {
$arrErr['category_name'] = '※ 既に同名のカテゴリが存在します。';
}
Expand Down
Loading

0 comments on commit 20138d0

Please sign in to comment.