Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"phpdocumentor/reflection-docblock": "~5.6.1",
"phpstan/phpstan": "^2.0",
"phpunit/phpunit": "^9.6",
"rector/rector": "^2.0",
"react/promise": "^3.3",
"symfony/yaml": "^5.4 || ^6.4"
},
Expand Down
59 changes: 59 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion data/class/SC_Display.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function setPrevURL()
public function prepare($page, $is_admin = false)
{
if (!$this->deviceSeted || !is_null($this->view)) {
$device = ($is_admin) ? DEVICE_TYPE_ADMIN : $this->detectDevice();
$device = ($is_admin) ? DEVICE_TYPE_ADMIN : static::detectDevice();
$this->setDevice($device);
}
$this->assignobj($page);
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 @@ -65,7 +65,7 @@ public function sendHeader()
header($name.': '.$head);
}
if (strlen($this->statusCode) >= 1) {
$this->sendHttpStatus($this->statusCode);
static::sendHttpStatus($this->statusCode);
}
}

Expand Down
12 changes: 6 additions & 6 deletions data/class/helper/SC_Helper_DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public function sfGetRootId()
$category_id = SC_Helper_DB_Ex::sfGetCategoryId($_GET['product_id'], $_GET['category_id']);
// ROOTカテゴリIDの取得
if (count($category_id) > 0) {
$arrRet = $this->sfGetParentsArray('dtb_category', 'parent_category_id', 'category_id', $category_id);
$arrRet = static::sfGetParentsArray('dtb_category', 'parent_category_id', 'category_id', $category_id);
$root_id = $arrRet[0] ?? '';
} else {
$root_id = '';
Expand Down Expand Up @@ -344,7 +344,7 @@ public static function sfGetRollbackPoint($order_id, $use_point, $add_point, $or
$rollback_point = $arrRet['point'];

// 対応状況がポイント利用対象の場合、使用ポイント分を戻す
if (SC_Helper_Purchase_Ex::isUsePoint($order_status)) {
if ((new SC_Helper_Purchase_Ex())->isUsePoint($order_status)) {
$rollback_point += $use_point;
}

Expand Down Expand Up @@ -500,7 +500,7 @@ public function sfGetCatCombName($category_id)
{
// 商品が属するカテゴリIDを縦に取得
$objQuery = SC_Query_Ex::getSingletonInstance();
$arrCatID = $this->sfGetParentsArray('dtb_category', 'parent_category_id', 'category_id', $category_id);
$arrCatID = static::sfGetParentsArray('dtb_category', 'parent_category_id', 'category_id', $category_id);
$ConbName = '';

// カテゴリ名称を取得する
Expand Down Expand Up @@ -530,7 +530,7 @@ public function sfGetFirstCat($category_id)
// 商品が属するカテゴリIDを縦に取得
$objQuery = SC_Query_Ex::getSingletonInstance();
$arrRet = [];
$arrCatID = $this->sfGetParentsArray('dtb_category', 'parent_category_id', 'category_id', $category_id);
$arrCatID = static::sfGetParentsArray('dtb_category', 'parent_category_id', 'category_id', $category_id);
$arrRet['id'] = $arrCatID[0];

// カテゴリ名称を取得する
Expand Down Expand Up @@ -1565,9 +1565,9 @@ public function sfGetMakerId($product_id, $maker_id = 0, $closed = false)
$this->g_maker_on = true;
$maker_id = (int) $maker_id;
$product_id = (int) $product_id;
if (SC_Utils_Ex::sfIsInt($maker_id) && $maker_id != 0 && $this->sfIsRecord('dtb_maker', 'maker_id', $maker_id)) {
if (SC_Utils_Ex::sfIsInt($maker_id) && $maker_id != 0 && static::sfIsRecord('dtb_maker', 'maker_id', $maker_id)) {
$this->g_maker_id = [$maker_id];
} elseif (SC_Utils_Ex::sfIsInt($product_id) && $product_id != 0 && $this->sfIsRecord('dtb_products', 'product_id', $product_id, $status)) {
} elseif (SC_Utils_Ex::sfIsInt($product_id) && $product_id != 0 && static::sfIsRecord('dtb_products', 'product_id', $product_id, $status)) {
$objQuery = SC_Query_Ex::getSingletonInstance();
$maker_id = $objQuery->getCol('maker_id', 'dtb_products', 'product_id = ?', [$product_id]);
$this->g_maker_id = $maker_id;
Expand Down
6 changes: 3 additions & 3 deletions data/class/helper/SC_Helper_Delivery.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ public function get($deliv_id, $has_deleted = false)
$arrDeliv = $arrRet[0];

// お届け時間の取得
$arrDeliv['deliv_time'] = $this->getDelivTime($deliv_id);
$arrDeliv['deliv_time'] = static::getDelivTime($deliv_id);

// 配送料金の取得
$arrDeliv['deliv_fee'] = $this->getDelivFeeList($deliv_id);
$arrDeliv['deliv_fee'] = static::getDelivFeeList($deliv_id);

// 支払方法
$arrDeliv['payment_ids'] = $this->getPayments($deliv_id);
$arrDeliv['payment_ids'] = static::getPayments($deliv_id);

return $arrDeliv;
}
Expand Down
2 changes: 1 addition & 1 deletion data/class/helper/SC_Helper_PageLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ public function setBlocPathTo($device_type_id = DEVICE_TYPE_PC, &$arrBlocs = [])
foreach ($arrBlocs as $key => $value) {
$arrBloc = &$arrBlocs[$key];
$arrBloc['php_path'] = SC_Utils_Ex::isBlank($arrBloc['php_path']) ? '' : HTML_REALDIR.$arrBloc['php_path'];
$bloc_dir = $this->getTemplatePath($device_type_id).BLOC_DIR;
$bloc_dir = static::getTemplatePath($device_type_id).BLOC_DIR;
$arrBloc['tpl_path'] = SC_Utils_Ex::isBlank($arrBloc['tpl_path']) ? '' : $bloc_dir.$arrBloc['tpl_path'];
}
}
Expand Down
30 changes: 15 additions & 15 deletions data/class/helper/SC_Helper_Purchase.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,28 +93,28 @@ public function completeOrder($orderStatus = ORDER_NEW)
}

$uniqId = $objSiteSession->getUniqId();
$this->verifyChangeCart($uniqId, $objCartSession);
static::verifyChangeCart($uniqId, $objCartSession);

$orderTemp = $this->getOrderTemp($uniqId);
$orderTemp = static::getOrderTemp($uniqId);

$orderTemp['status'] = $orderStatus;
$cartkey = $objCartSession->getKey();
$order_id = $this->registerOrderComplete($orderTemp, $objCartSession, $cartkey);
$isMultiple = self::isMultiple();
$shippingTemp = &$this->getShippingTemp($isMultiple);
$shippingTemp = &static::getShippingTemp($isMultiple);
foreach ($shippingTemp as $shippingId => $val) {
$this->registerShipmentItem($order_id, $shippingId, $val['shipment_item']);
static::registerShipmentItem($order_id, $shippingId, $val['shipment_item']);
}

$this->registerShipping($order_id, $shippingTemp);
static::registerShipping($order_id, $shippingTemp);
$objQuery->commit();

// 会員情報の最終購入日、購入合計を更新
if ($customerId > 0) {
SC_Customer_Ex::updateOrderSummary($customerId);
}

$this->cleanupSession($order_id, $objCartSession, $objCustomer, $cartkey);
static::cleanupSession($order_id, $objCartSession, $objCustomer, $cartkey);

GC_Utils_Ex::gfPrintLog('order complete. order_id='.$order_id);
}
Expand Down Expand Up @@ -888,7 +888,7 @@ public function registerOrderComplete($orderParams, &$objCartSession, $cartKey)
$orderParams['create_date'] = 'CURRENT_TIMESTAMP';
$orderParams['update_date'] = 'CURRENT_TIMESTAMP';

$this->registerOrder($orderParams['order_id'], $orderParams);
static::registerOrder($orderParams['order_id'], $orderParams);

// 詳細情報を取得
$cartItems = $objCartSession->getCartList($cartKey, $orderParams['order_pref'] ?? 0, $orderParams['order_country_id'] ?? 0);
Expand Down Expand Up @@ -920,7 +920,7 @@ public function registerOrderComplete($orderParams, &$objCartSession, $cartKey)
}
$i++;
}
$this->registerOrderDetail($orderParams['order_id'], $arrDetail);
static::registerOrderDetail($orderParams['order_id'], $arrDetail);

$objQuery->update(
'dtb_order_temp',
Expand Down Expand Up @@ -1155,7 +1155,7 @@ public function getShippings($order_id, $has_items = true)
if ($has_items) {
foreach ($arrResults as $shipping_id => $value) {
$arrResults[$shipping_id]['shipment_item']
= &$this->getShipmentItems($order_id, $shipping_id);
= &static::getShipmentItems($order_id, $shipping_id);
}
}

Expand Down Expand Up @@ -1524,7 +1524,7 @@ public function checkDbAllPendingOrder()
if (!SC_Utils_Ex::isBlank($arrOrders)) {
foreach ($arrOrders as $arrOrder) {
$order_id = $arrOrder['order_id'];
SC_Helper_Purchase_Ex::cancelOrder($order_id, ORDER_CANCEL, true);
(new SC_Helper_Purchase_Ex())->cancelOrder($order_id, ORDER_CANCEL, true);
GC_Utils_Ex::gfPrintLog('order cancel.(time expire) order_id='.$order_id);
}
}
Expand Down Expand Up @@ -1553,10 +1553,10 @@ public function checkDbMyPendignOrder()
$target_time = strtotime('-'.$term.' sec');
$create_time = strtotime($arrOrder['create_date']);
if (SC_Utils_Ex::isBlank($cartKeys) && $target_time < $create_time) {
SC_Helper_Purchase_Ex::rollbackOrder($order_id, ORDER_CANCEL, true);
(new SC_Helper_Purchase_Ex())->rollbackOrder($order_id, ORDER_CANCEL, true);
GC_Utils_Ex::gfPrintLog('order rollback.(my pending) order_id='.$order_id);
} else {
SC_Helper_Purchase_Ex::cancelOrder($order_id, ORDER_CANCEL, true);
(new SC_Helper_Purchase_Ex())->cancelOrder($order_id, ORDER_CANCEL, true);
if ($target_time > $create_time) {
GC_Utils_Ex::gfPrintLog('order cancel.(my pending and time expire) order_id='.$order_id);
} else {
Expand All @@ -1565,7 +1565,7 @@ public function checkDbMyPendignOrder()
}
}
} else {
SC_Helper_Purchase_Ex::cancelOrder($order_id, ORDER_CANCEL, true);
(new SC_Helper_Purchase_Ex())->cancelOrder($order_id, ORDER_CANCEL, true);
GC_Utils_Ex::gfPrintLog('order cancel.(my old pending) order_id='.$order_id);
}
}
Expand All @@ -1592,10 +1592,10 @@ public function checkSessionPendingOrder()
$objCartSess = new SC_CartSession_Ex();
$cartKeys = $objCartSess->getKeys();
if (SC_Utils_Ex::isBlank($cartKeys)) {
SC_Helper_Purchase_Ex::rollbackOrder($order_id, ORDER_CANCEL, true);
(new SC_Helper_Purchase_Ex())->rollbackOrder($order_id, ORDER_CANCEL, true);
GC_Utils_Ex::gfPrintLog('order rollback.(session pending) order_id='.$order_id);
} else {
SC_Helper_Purchase_Ex::cancelOrder($order_id, ORDER_CANCEL, true);
(new SC_Helper_Purchase_Ex())->cancelOrder($order_id, ORDER_CANCEL, true);
GC_Utils_Ex::gfPrintLog('order rollback.(session pending and set card) order_id='.$order_id);
}
}
Expand Down
3 changes: 3 additions & 0 deletions data/class/pages/contact/LC_Page_Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
*/
class LC_Page_Contact extends LC_Page_Ex
{
public $tpl_shopname;
public $tpl_infoemail;

/**
* Page を初期化する.
*
Expand Down
19 changes: 19 additions & 0 deletions data/class/pages/guide/LC_Page_Guide_Kiyaku.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,25 @@
*/
class LC_Page_Guide_Kiyaku extends LC_Page_Ex
{
public $tpl_kiyaku_title;
public $tpl_kiyaku_text;
/**
* @var int
*/
public $tpl_kiyaku_index;
/**
* @var int
*/
public $tpl_kiyaku_last_index;
/**
* @var bool
*/
public $tpl_kiyaku_is_first;
/**
* @var bool
*/
public $tpl_kiyaku_is_last;

/**
* Page を初期化する.
*
Expand Down
4 changes: 4 additions & 0 deletions data/class/pages/products/LC_Page_Products_Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@
*/
class LC_Page_Products_Detail extends LC_Page_Ex
{
/**
* @var mixed[]
*/
public $arrClassCat2;
/** 商品ステータス */
public $arrSTATUS;

Expand Down
40 changes: 40 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

declare(strict_types=1);
require __DIR__ . '/data/vendor/autoload.php';
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
use Rector\Config\RectorConfig;
use Rector\PHPUnit\Set\PHPUnitSetList;
use Rector\Php70\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector;
use Rector\Php70\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector;
use Rector\Set\ValueObject\SetList;
use Rector\ValueObject\PhpVersion;

return RectorConfig::configure()
// EC-CUBEのPHPバージョンに合わせて設定
->withPhpVersion(PhpVersion::PHP_74)
// Rectorが解析するパスを指定
->withPaths([
__DIR__ . '/html',
__DIR__ . '/data',
// __DIR__ . '/tests',
])
// スキップするパスやルールを指定
->withSkip([
__DIR__ . '/data/vendor',
__DIR__ . '/data/downloads',
__DIR__ . '/data/Smarty',
__DIR__ . '/html/install/temp',
])
->withRules([
CompleteDynamicPropertiesRector::class,
ThisCallOnStaticMethodToStaticCallRector::class,
StaticCallOnNonStaticToInstanceCallRector::class,
])
// uncomment to reach your current PHP version
->withSets([
// SetList::DEAD_CODE,
// LevelSetList::UP_TO_PHP_84, // PHPバージョンに合わせる
PHPUnitSetList::PHPUNIT_CODE_QUALITY,
PHPUnitSetList::PHPUNIT_90, // PHPUnitのバージョンに合わせる
]);
Loading