From 5a3da43640bc7c39ccb2b55eda6628eca166f7bf Mon Sep 17 00:00:00 2001 From: sunxyw Date: Tue, 15 Nov 2022 23:11:24 +0800 Subject: [PATCH] fix unused argument --- src/ZM/Exception/InvalidArgumentException.php | 2 +- src/entry.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ZM/Exception/InvalidArgumentException.php b/src/ZM/Exception/InvalidArgumentException.php index babe269f..355d93e2 100644 --- a/src/ZM/Exception/InvalidArgumentException.php +++ b/src/ZM/Exception/InvalidArgumentException.php @@ -9,6 +9,6 @@ class InvalidArgumentException extends ZMException public function __construct($message = '', $code = 0, \Throwable $previous = null) { // TODO: change this to a better error message - parent::__construct($message, '', 74, $previous); + parent::__construct($message, '', $code ?: 74, $previous); } } diff --git a/src/entry.php b/src/entry.php index 754cf405..622549c8 100644 --- a/src/entry.php +++ b/src/entry.php @@ -2,13 +2,14 @@ declare(strict_types=1); -use OneBot\Driver\ExceptionHandler; - /** * CLI Application 入口文件,先引入 Composer 组件 * * @noinspection PhpIncludeInspection */ + +use OneBot\Exception\ExceptionHandler; + require_once((!is_dir(__DIR__ . '/../vendor')) ? getcwd() : (__DIR__ . '/..')) . '/vendor/autoload.php'; // 适配 Windows 的 conhost 中文显示,因为使用 micro 打包框架运行的时候在 Windows 运行中文部分会变成乱码