fix styles

This commit is contained in:
sunxyw
2022-11-08 17:33:25 +08:00
parent aa29dc99f3
commit 723dfd30a2
9 changed files with 22 additions and 12 deletions

View File

@@ -143,7 +143,7 @@ function container(): ContainerInterface
* 解析类实例(使用容器) * 解析类实例(使用容器)
* *
* @template T * @template T
* @param class-string<T> $abstract * @param class-string<T> $abstract
* @return Closure|mixed|T * @return Closure|mixed|T
* @noinspection PhpDocMissingThrowsInspection * @noinspection PhpDocMissingThrowsInspection
*/ */
@@ -157,7 +157,7 @@ function resolve(string $abstract, array $parameters = [])
* 获取容器实例 * 获取容器实例
* *
* @template T * @template T
* @param null|class-string<T> $abstract * @param null|class-string<T> $abstract
* @return Closure|ContainerInterface|mixed|T * @return Closure|ContainerInterface|mixed|T
*/ */
function app(string $abstract = null, array $parameters = []) function app(string $abstract = null, array $parameters = [])
@@ -196,8 +196,8 @@ function sql_builder(string $name = '')
* 传入数组,设置配置项 * 传入数组,设置配置项
* 不传参数,返回配置容器 * 不传参数,返回配置容器
* *
* @param array|string|null $key 键名 * @param null|array|string $key 键名
* @param mixed|null $default 默认值 * @param null|mixed $default 默认值
* @return mixed|void|ZMConfig * @return mixed|void|ZMConfig
*/ */
function config(array|string $key = null, mixed $default = null) function config(array|string $key = null, mixed $default = null)

View File

@@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
namespace ZM\Bootstrap; namespace ZM\Bootstrap;
use OneBot\Driver\ExceptionHandler; use OneBot\Driver\ExceptionHandler;

View File

@@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
namespace ZM\Bootstrap; namespace ZM\Bootstrap;
use OneBot\Driver\Workerman\Worker; use OneBot\Driver\Workerman\Worker;
@@ -56,8 +58,8 @@ class LoadConfiguration
$config->set('global.driver', $y); $config->set('global.driver', $y);
break; break;
case 'worker-num': // 动态设置 Worker 数量 case 'worker-num': // 动态设置 Worker 数量
$config->set('global.swoole_options.swoole_set.worker_num', (int)$y); $config->set('global.swoole_options.swoole_set.worker_num', (int) $y);
$config->set('global.workerman_options.workerman_worker_num', (int)$y); $config->set('global.workerman_options.workerman_worker_num', (int) $y);
break; break;
case 'daemon': // 启动为守护进程 case 'daemon': // 启动为守护进程
$config->set('global.swoole_options.swoole_set.daemonize', 1); $config->set('global.swoole_options.swoole_set.daemonize', 1);

View File

@@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
namespace ZM\Bootstrap; namespace ZM\Bootstrap;
class LoadGlobalDefines class LoadGlobalDefines

View File

@@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
namespace ZM\Bootstrap; namespace ZM\Bootstrap;
use ZM\Event\EventProvider; use ZM\Event\EventProvider;

View File

@@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
namespace ZM\Bootstrap; namespace ZM\Bootstrap;
use ZM\Logger\ConsoleLogger; use ZM\Logger\ConsoleLogger;

View File

@@ -1,5 +1,7 @@
<?php <?php
declare(strict_types=1);
namespace ZM\Bootstrap; namespace ZM\Bootstrap;
class SetInternalTimezone class SetInternalTimezone

View File

@@ -1,9 +1,10 @@
<?php <?php
declare(strict_types=1);
namespace ZM\Exception; namespace ZM\Exception;
use OneBot\Driver\ExceptionHandler; use OneBot\Driver\ExceptionHandler;
use Throwable;
class Handler extends ExceptionHandler class Handler extends ExceptionHandler
{ {
@@ -13,7 +14,7 @@ class Handler extends ExceptionHandler
// 将会在稍后修复 // 将会在稍后修复
} }
public function handle(Throwable $e): void public function handle(\Throwable $e): void
{ {
if ($e instanceof ZMKnownException) { if ($e instanceof ZMKnownException) {
// 如果是已知异常,则可以输出问题说明和解决方案 // 如果是已知异常,则可以输出问题说明和解决方案

View File

@@ -27,13 +27,10 @@ use ZM\Event\Listener\ManagerEventListener;
use ZM\Event\Listener\MasterEventListener; use ZM\Event\Listener\MasterEventListener;
use ZM\Event\Listener\WorkerEventListener; use ZM\Event\Listener\WorkerEventListener;
use ZM\Event\Listener\WSEventListener; use ZM\Event\Listener\WSEventListener;
use ZM\Exception\ConfigException;
use ZM\Exception\InitException; use ZM\Exception\InitException;
use ZM\Exception\ZMKnownException; use ZM\Exception\ZMKnownException;
use ZM\Logger\ConsoleLogger;
use ZM\Logger\TablePrinter; use ZM\Logger\TablePrinter;
use ZM\Process\ProcessStateManager; use ZM\Process\ProcessStateManager;
use ZM\Bootstrap;
/** /**
* 框架入口类 * 框架入口类
@@ -71,7 +68,7 @@ class Framework
/** /**
* 框架初始化文件 * 框架初始化文件
* *
* @param array<string, null|bool|string> $argv 传入的参数(见 ServerStartCommand * @param array<string, null|bool|string> $argv 传入的参数(见 ServerStartCommand
* @throws InitException * @throws InitException
* @throws \Exception * @throws \Exception
*/ */