refactor: use phpstan stubs instead of opencart sources

This commit is contained in:
2025-12-01 18:17:32 +03:00
parent 5fe4aac7eb
commit f02ef42cb7
8 changed files with 92 additions and 6 deletions

View File

@@ -6,10 +6,6 @@ parameters:
- framework - framework
scanDirectories: scanDirectories:
- /web/upload/system - stubs
scanFiles:
- /web/upload/config.php
- /web/upload/admin/config.php
inferPrivatePropertyTypeFromConstructor: true inferPrivatePropertyTypeFromConstructor: true

View File

@@ -119,7 +119,7 @@ class CartService
'product_option_id' => (int) $option['product_option_id'], 'product_option_id' => (int) $option['product_option_id'],
'product_option_value_id' => (int) $option['product_option_value_id'], 'product_option_value_id' => (int) $option['product_option_value_id'],
'name' => $option['name'], 'name' => $option['name'],
'value' => (utf8_strlen($value) > 20 ? utf8_substr($value, 0, 20) . '..' : $value), 'value' => (strlen($value) > 20 ? substr($value, 0, 20) . '..' : $value),
'type' => $option['type'], 'type' => $option['type'],
]; ];
} }

View File

@@ -0,0 +1,7 @@
<?php
namespace Cart;
class Cart
{
}

View File

@@ -0,0 +1,5 @@
<?php
class Proxy
{
}

View File

@@ -0,0 +1,5 @@
<?php
final class Registry
{
}

View File

@@ -0,0 +1,7 @@
<?php
namespace Cart;
final class Tax
{
}

View File

@@ -0,0 +1,28 @@
<?php
// HTTP
define('HTTP_SERVER', 'https://api.tg.nikitakiselev.ru/');
// HTTPS
define('HTTPS_SERVER', 'https://api.tg.nikitakiselev.ru/');
// DIR
define('DIR_APPLICATION', '/web/upload/catalog/');
define('DIR_SYSTEM', '/web/upload/system/');
define('DIR_IMAGE', '/web/upload/image/');
define('DIR_STORAGE', '/web/storage/');
define('DIR_LANGUAGE', DIR_APPLICATION . 'language/');
define('DIR_TEMPLATE', DIR_APPLICATION . 'view/theme/');
define('DIR_CONFIG', DIR_SYSTEM . 'config/');
define('DIR_CACHE', DIR_STORAGE . 'cache/');
define('DIR_DOWNLOAD', DIR_STORAGE . 'download/');
define('DIR_LOGS', DIR_STORAGE . 'logs/');
define('DIR_MODIFICATION', DIR_STORAGE . 'modification/');
define('DIR_SESSION', DIR_STORAGE . 'session/');
define('DIR_UPLOAD', DIR_STORAGE . 'upload/');
// DB
define('DB_DRIVER', 'mysqli');
define('DB_HOSTNAME', 'mysql');
define('DB_USERNAME', 'root');
define('DB_PASSWORD', 'secret');
define('DB_DATABASE', 'ocstore3');
define('DB_PREFIX', 'oc_');
define('DB_PORT', '3306');

View File

@@ -0,0 +1,38 @@
<?php
namespace Cart;
class Currency
{
public function format($number, $currency, $value = '', $format = true)
{
}
public function convert($value, $from, $to)
{
}
public function getId($currency)
{
}
public function getSymbolLeft($currency)
{
}
public function getSymbolRight($currency)
{
}
public function getDecimalPlace($currency)
{
}
public function getValue($currency)
{
}
public function has($currency)
{
}
}