mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 15:45:36 +08:00
fix styles
This commit is contained in:
@@ -12,11 +12,11 @@ class ConfigException extends ZMException
|
||||
|
||||
public static function unsupportedFileType(string $file_path): ConfigException
|
||||
{
|
||||
return new self("不支持的配置文件类型:{$file_path}", "请检查配置文件的后缀名是否正确", self::UNSUPPORTED_FILE_TYPE);
|
||||
return new self("不支持的配置文件类型:{$file_path}", '请检查配置文件的后缀名是否正确', self::UNSUPPORTED_FILE_TYPE);
|
||||
}
|
||||
|
||||
public static function loadConfigFailed(string $file_path, string $message): ConfigException
|
||||
{
|
||||
return new self("加载配置文件失败:{$file_path},{$message}", "请检查配置文件的格式是否正确,并尝试按照错误信息排查", self::LOAD_CONFIG_FAILED);
|
||||
return new self("加载配置文件失败:{$file_path},{$message}", '请检查配置文件的格式是否正确,并尝试按照错误信息排查', self::LOAD_CONFIG_FAILED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,11 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace ZM\Exception;
|
||||
|
||||
use Throwable;
|
||||
|
||||
class InitException extends ZMException
|
||||
{
|
||||
public function __construct(string $message = '', int $code = 0, ?Throwable $previous = null)
|
||||
public function __construct(string $message = '', int $code = 0, ?\Throwable $previous = null)
|
||||
{
|
||||
// TODO: change this to a better error message
|
||||
parent::__construct($message, '', $code, $previous);
|
||||
|
||||
@@ -4,11 +4,9 @@ declare(strict_types=1);
|
||||
|
||||
namespace ZM\Exception;
|
||||
|
||||
use Throwable;
|
||||
|
||||
abstract class ZMException extends \Exception
|
||||
{
|
||||
public function __construct(string $description, string $solution = '', int $code = 0, ?Throwable $previous = null)
|
||||
public function __construct(string $description, string $solution = '', int $code = 0, ?\Throwable $previous = null)
|
||||
{
|
||||
parent::__construct($description . PHP_EOL . $solution, $code, $previous);
|
||||
}
|
||||
|
||||
@@ -14,10 +14,10 @@ class ZMKnownException extends ZMException
|
||||
parent::__construct(zm_internal_errcode($err_code) . $message, $code, $previous);
|
||||
if ($err_code === 'E99999') {
|
||||
$code = 0;
|
||||
// 这也太懒了吧
|
||||
// 这也太懒了吧
|
||||
} else {
|
||||
// 取最后两数
|
||||
$code = (int)substr($err_code, -2);
|
||||
$code = (int) substr($err_code, -2);
|
||||
}
|
||||
parent::__construct($message, '', $code, $previous);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user