update api docs

This commit is contained in:
crazywhalecc
2022-08-22 07:39:44 +00:00
committed by github-actions[bot]
parent 53c1c0103c
commit e83a169fd6
35 changed files with 3069 additions and 527 deletions

View File

@@ -3,7 +3,7 @@
## parseUri
```php
public function parseUri(mixed $request, mixed $response, mixed $uri, mixed $node, mixed $params): mixed
public function parseUri(OneBot\Http\ServerRequest $request, mixed $node, mixed $params): int
```
### 描述
@@ -14,9 +14,7 @@ public function parseUri(mixed $request, mixed $response, mixed $uri, mixed $nod
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| request | mixed | |
| response | mixed | |
| uri | mixed | |
| request | OneBot\Http\ServerRequest | |
| node | mixed | |
| params | mixed | |
@@ -24,13 +22,13 @@ public function parseUri(mixed $request, mixed $response, mixed $uri, mixed $nod
| 类型 | 描述 |
| ---- | ----------- |
| mixed | |
| int | |
## handleStaticPage
```php
public function handleStaticPage(Response|\Swoole\Http\Response $response, string $uri, array $settings): bool
public function handleStaticPage(string $uri, array $settings): Psr\Http\Message\ResponseInterface
```
### 描述
@@ -41,7 +39,6 @@ public function handleStaticPage(Response|\Swoole\Http\Response $response, strin
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| response | Response|\Swoole\Http\Response | |
| uri | string | |
| settings | array | |
@@ -49,4 +46,52 @@ public function handleStaticPage(Response|\Swoole\Http\Response $response, strin
| 类型 | 描述 |
| ---- | ----------- |
| bool | |
| Psr\Http\Message\ResponseInterface | |
## handleHttpCodePage
```php
public function handleHttpCodePage(int $code): Psr\Http\Message\ResponseInterface
```
### 描述
作者很懒,什么也没有说
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| code | int | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| Psr\Http\Message\ResponseInterface | |
## createJsonResponse
```php
public function createJsonResponse(array $data, int $http_code, int $json_flag): Psr\Http\Message\ResponseInterface
```
### 描述
作者很懒,什么也没有说
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| data | array | |
| http_code | int | |
| json_flag | int | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| Psr\Http\Message\ResponseInterface | |

View File

@@ -3,24 +3,24 @@
## getParameterClassName
```php
public function getParameterClassName(ReflectionParameter $parameter): null|string
public function getParameterClassName(ReflectionParameter $parameter): string
```
### 描述
获取参数的类名(如有)
作者很懒,什么也没有说
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| parameter | ReflectionParameter | 参数 |
| parameter | ReflectionParameter | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| null|string | 类名,如果参数不是类,返回 null |
| string | |
## variableToString
@@ -31,7 +31,7 @@ public function variableToString(mixed $var): string
### 描述
将传入变量转换为字符串
作者很懒,什么也没有说
### 参数
@@ -49,18 +49,18 @@ public function variableToString(mixed $var): string
## isNonStaticMethod
```php
public function isNonStaticMethod(callable|string $callback): bool
public function isNonStaticMethod(mixed $callback): bool
```
### 描述
判断传入的回调是否为任意类的非静态方法
作者很懒,什么也没有说
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| callback | callable|string | 回调 |
| callback | mixed | |
### 返回
@@ -72,21 +72,18 @@ public function isNonStaticMethod(callable|string $callback): bool
## getCallReflector
```php
public function getCallReflector(callable|string $callback): ReflectionFunctionAbstract
public function getCallReflector(mixed $callback): ReflectionFunctionAbstract
```
### 描述
获取传入的回调的反射实例
如果传入的是类方法,则会返回 {@link ReflectionMethod} 实例
否则将返回 {@link ReflectionFunction} 实例
可传入实现了 __invoke 的类
作者很懒,什么也没有说
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| callback | callable|string | 回调 |
| callback | mixed | |
### 返回

View File

@@ -1,9 +1,9 @@
# ZM\Utils\ZMUtil
## stop
## getComposerMetadata
```php
public function stop(mixed $error_exit): mixed
public function getComposerMetadata(string $path): array
```
### 描述
@@ -14,70 +14,10 @@ public function stop(mixed $error_exit): mixed
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| error_exit | mixed | |
| path | string | |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| mixed | |
## reload
```php
public function reload(): mixed
```
### 描述
作者很懒,什么也没有说
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| mixed | |
## getReloadableFiles
```php
public function getReloadableFiles(): string[]|string[][]
```
### 描述
在工作进程中返回可以通过reload重新加载的php文件列表
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| string[]|string[][] | |
## getClassesPsr4
```php
public function getClassesPsr4(string $dir, string $base_namespace, null|mixed $rule, bool|string $return_path_value): string[]
```
### 描述
使用Psr-4标准获取目录下的所有类
### 参数
| 名称 | 类型 | 描述 |
| -------- | ---- | ----------- |
| dir | string | 目录 |
| base_namespace | string | 基础命名空间 |
| rule | null|mixed | 规则 |
| return_path_value | bool|string | 是否返回文件路径,返回文件路径的话传入字符串 |
### 返回
| 类型 | 描述 |
| ---- | ----------- |
| string[] | |
| array | |