mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-22 16:15:34 +08:00
update api docs
This commit is contained in:
@@ -111,7 +111,7 @@ public function getDataFolder(string $second): null|array|false|mixed|string
|
||||
## saveToJson
|
||||
|
||||
```php
|
||||
public function saveToJson(mixed $filename, mixed $file_array): false|int
|
||||
public function saveToJson(string $filename, array|int|Iterator|JsonSerializable|string|Traversable $file_array): false|int
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -122,20 +122,20 @@ public function saveToJson(mixed $filename, mixed $file_array): false|int
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| filename | mixed | |
|
||||
| file_array | mixed | |
|
||||
| filename | string | 文件名 |
|
||||
| file_array | array|int|Iterator|JsonSerializable|string|Traversable | 文件内容数组 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| false|int | |
|
||||
| false|int | 返回文件大小或false |
|
||||
|
||||
|
||||
## loadFromJson
|
||||
|
||||
```php
|
||||
public function loadFromJson(mixed $filename): null|mixed
|
||||
public function loadFromJson(string $filename): null|mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -146,19 +146,19 @@ public function loadFromJson(mixed $filename): null|mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| filename | mixed | |
|
||||
| filename | string | 文件名 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| null|mixed | |
|
||||
| null|mixed | 返回文件内容数据或null |
|
||||
|
||||
|
||||
## scanDirFiles
|
||||
|
||||
```php
|
||||
public function scanDirFiles(mixed $dir, bool|string $relative, bool $recursive): array|false
|
||||
public function scanDirFiles(string $dir, bool $recursive, bool|string $relative): array|false
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -169,9 +169,9 @@ public function scanDirFiles(mixed $dir, bool|string $relative, bool $recursive)
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| dir | mixed | |
|
||||
| relative | bool|string | |
|
||||
| recursive | bool | |
|
||||
| dir | string | 目录 |
|
||||
| recursive | bool | 是否递归扫描子目录 |
|
||||
| relative | bool|string | 是否返回相对目录,如果为true则返回相对目录,如果为false则返回绝对目录 |
|
||||
|
||||
### 返回
|
||||
|
||||
@@ -183,7 +183,7 @@ public function scanDirFiles(mixed $dir, bool|string $relative, bool $recursive)
|
||||
## isRelativePath
|
||||
|
||||
```php
|
||||
public function isRelativePath(mixed $path): bool
|
||||
public function isRelativePath(string $path): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -194,10 +194,10 @@ public function isRelativePath(mixed $path): bool
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| path | mixed | |
|
||||
| path | string | 路径 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| bool | |
|
||||
| bool | 返回结果 |
|
||||
|
||||
@@ -30,7 +30,7 @@ public function parseUri(mixed $request, mixed $response, mixed $uri, mixed $nod
|
||||
## handleStaticPage
|
||||
|
||||
```php
|
||||
public function handleStaticPage(mixed $uri, Response|\Swoole\Http\Response $response, array $settings): bool
|
||||
public function handleStaticPage(Response|\Swoole\Http\Response $response, string $uri, array $settings): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -41,8 +41,8 @@ public function handleStaticPage(mixed $uri, Response|\Swoole\Http\Response $res
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| uri | mixed | |
|
||||
| response | Response|\Swoole\Http\Response | |
|
||||
| uri | string | |
|
||||
| settings | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
@@ -44,7 +44,7 @@ public function packModule(array $module, string $target): bool
|
||||
## unpackModule
|
||||
|
||||
```php
|
||||
public function unpackModule(mixed $module, array $options): array|false
|
||||
public function unpackModule(array|Iterator $module, array $options): array|false
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -55,11 +55,11 @@ public function unpackModule(mixed $module, array $options): array|false
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| module | mixed | |
|
||||
| module | array|Iterator | 模块信息 |
|
||||
| options | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array|false | |
|
||||
| array|false | 返回解包的信息或false |
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
## workerAction
|
||||
|
||||
```php
|
||||
public function workerAction(mixed $src_worker_id, mixed $data): mixed
|
||||
public function workerAction(int $src_worker_id, array $data): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -14,8 +14,8 @@ Worker 进程间通信触发的动作类型函数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| src_worker_id | mixed | |
|
||||
| data | mixed | |
|
||||
| src_worker_id | int | 源 Worker 进程 ID |
|
||||
| data | array | 数据 |
|
||||
|
||||
### 返回
|
||||
|
||||
@@ -27,7 +27,7 @@ Worker 进程间通信触发的动作类型函数
|
||||
## sendActionToWorker
|
||||
|
||||
```php
|
||||
public function sendActionToWorker(mixed $worker_id, mixed $action, mixed $data): mixed
|
||||
public function sendActionToWorker(int $worker_id, string $action, mixed $data): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -38,9 +38,9 @@ public function sendActionToWorker(mixed $worker_id, mixed $action, mixed $data)
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| worker_id | mixed | |
|
||||
| action | mixed | |
|
||||
| data | mixed | |
|
||||
| worker_id | int | 进程ID |
|
||||
| action | string | 动作 |
|
||||
| data | mixed | 参数 |
|
||||
|
||||
### 返回
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
## downloadCQImage
|
||||
|
||||
```php
|
||||
public function downloadCQImage(mixed $msg, string $path): array|false
|
||||
public function downloadCQImage(array|string $msg, null|string $path): array|false
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -14,20 +14,20 @@ public function downloadCQImage(mixed $msg, string $path): array|false
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| msg | mixed | |
|
||||
| path | string | |
|
||||
| msg | array|string | 消息或消息数组 |
|
||||
| path | null|string | 保存路径 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array|false | |
|
||||
| array|false | 返回图片信息或失败返回false |
|
||||
|
||||
|
||||
## containsImage
|
||||
|
||||
```php
|
||||
public function containsImage(mixed $msg): bool
|
||||
public function containsImage(array|string $msg): bool
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -38,7 +38,7 @@ public function containsImage(mixed $msg): bool
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| msg | mixed | |
|
||||
| msg | array|string | 消息或消息数组 |
|
||||
|
||||
### 返回
|
||||
|
||||
@@ -50,7 +50,7 @@ public function containsImage(mixed $msg): bool
|
||||
## getImageCQFromLocal
|
||||
|
||||
```php
|
||||
public function getImageCQFromLocal(mixed $file, int $type): string
|
||||
public function getImageCQFromLocal(string $file, int $type): string
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -64,8 +64,8 @@ type == 2 : 返回图片的 http://xxx CQ 码(默认为 /images/ 路径就是
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| file | mixed | |
|
||||
| type | int | |
|
||||
| file | string | 文件数据 |
|
||||
| type | int | 文件类型(0,1,2可选,默认为0) |
|
||||
|
||||
### 返回
|
||||
|
||||
@@ -77,7 +77,7 @@ type == 2 : 返回图片的 http://xxx CQ 码(默认为 /images/ 路径就是
|
||||
## splitCommand
|
||||
|
||||
```php
|
||||
public function splitCommand(mixed $msg): array|string[]
|
||||
public function splitCommand(string $msg): array|string[]
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -88,7 +88,7 @@ public function splitCommand(mixed $msg): array|string[]
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| msg | mixed | |
|
||||
| msg | string | 消息内容 |
|
||||
|
||||
### 返回
|
||||
|
||||
@@ -100,19 +100,19 @@ public function splitCommand(mixed $msg): array|string[]
|
||||
## matchCommand
|
||||
|
||||
```php
|
||||
public function matchCommand(mixed $msg, mixed $obj): ZM\Entity\MatchResult
|
||||
public function matchCommand(array|string $msg, array|Iterator $obj): ZM\Entity\MatchResult
|
||||
```
|
||||
|
||||
### 描述
|
||||
|
||||
作者很懒,什么也没有说
|
||||
根据CQCommand的规则匹配消息,获取是否匹配到对应的注解事件
|
||||
|
||||
### 参数
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| msg | mixed | |
|
||||
| obj | mixed | |
|
||||
| msg | array|string | 消息内容 |
|
||||
| obj | array|Iterator | 数据对象 |
|
||||
|
||||
### 返回
|
||||
|
||||
@@ -124,7 +124,7 @@ public function matchCommand(mixed $msg, mixed $obj): ZM\Entity\MatchResult
|
||||
## addShortCommand
|
||||
|
||||
```php
|
||||
public function addShortCommand(mixed $command, string $reply): mixed
|
||||
public function addShortCommand(string $command, string $reply): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -135,8 +135,8 @@ public function addShortCommand(mixed $command, string $reply): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| command | mixed | |
|
||||
| reply | string | |
|
||||
| command | string | 命令内容 |
|
||||
| reply | string | 回复内容 |
|
||||
|
||||
### 返回
|
||||
|
||||
@@ -148,7 +148,7 @@ public function addShortCommand(mixed $command, string $reply): mixed
|
||||
## strToArray
|
||||
|
||||
```php
|
||||
public function strToArray(mixed $msg, false $trim_text, bool $ignore_space): array
|
||||
public function strToArray(string $msg, bool $ignore_space, bool $trim_text): array
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -159,15 +159,15 @@ public function strToArray(mixed $msg, false $trim_text, bool $ignore_space): ar
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| msg | mixed | |
|
||||
| trim_text | false | |
|
||||
| ignore_space | bool | |
|
||||
| msg | string | 消息内容 |
|
||||
| ignore_space | bool | 是否忽略空行 |
|
||||
| trim_text | bool | 是否去除空格 |
|
||||
|
||||
### 返回
|
||||
|
||||
| 类型 | 描述 |
|
||||
| ---- | ----------- |
|
||||
| array | |
|
||||
| array | 返回数组 |
|
||||
|
||||
|
||||
## arrayToStr
|
||||
|
||||
@@ -43,7 +43,7 @@ public function signalManager(): mixed
|
||||
## signalWorker
|
||||
|
||||
```php
|
||||
public function signalWorker(mixed $worker_id, Swoole\Server $server): mixed
|
||||
public function signalWorker(int $worker_id, Swoole\Server $server): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -54,7 +54,7 @@ public function signalWorker(mixed $worker_id, Swoole\Server $server): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| worker_id | mixed | |
|
||||
| worker_id | int | 当前进程的ID |
|
||||
| server | Swoole\Server | |
|
||||
|
||||
### 返回
|
||||
|
||||
@@ -77,7 +77,7 @@ public function testlog(): mixed
|
||||
## call
|
||||
|
||||
```php
|
||||
public function call(mixed $it): mixed
|
||||
public function call(array $it): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -88,7 +88,7 @@ public function call(mixed $it): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| it | mixed | |
|
||||
| it | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
@@ -100,7 +100,7 @@ public function call(mixed $it): mixed
|
||||
## level
|
||||
|
||||
```php
|
||||
public function level(mixed $it): mixed
|
||||
public function level(array $it): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -111,7 +111,7 @@ public function level(mixed $it): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| it | mixed | |
|
||||
| it | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
@@ -123,7 +123,7 @@ public function level(mixed $it): mixed
|
||||
## bc
|
||||
|
||||
```php
|
||||
public function bc(mixed $it): mixed
|
||||
public function bc(array $it): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -134,7 +134,7 @@ public function bc(mixed $it): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| it | mixed | |
|
||||
| it | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
@@ -146,7 +146,7 @@ public function bc(mixed $it): mixed
|
||||
## echoI
|
||||
|
||||
```php
|
||||
public function echoI(mixed $it): mixed
|
||||
public function echoI(array $it): mixed
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -157,7 +157,7 @@ public function echoI(mixed $it): mixed
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| it | mixed | |
|
||||
| it | array | |
|
||||
|
||||
### 返回
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ public function getReloadableFiles(): string[]|string[][]
|
||||
## getClassesPsr4
|
||||
|
||||
```php
|
||||
public function getClassesPsr4(mixed $dir, mixed $base_namespace, null|mixed $rule, bool $return_path_value): string[]
|
||||
public function getClassesPsr4(string $dir, string $base_namespace, null|mixed $rule, bool $return_path_value): string[]
|
||||
```
|
||||
|
||||
### 描述
|
||||
@@ -71,10 +71,10 @@ public function getClassesPsr4(mixed $dir, mixed $base_namespace, null|mixed $ru
|
||||
|
||||
| 名称 | 类型 | 描述 |
|
||||
| -------- | ---- | ----------- |
|
||||
| dir | mixed | |
|
||||
| base_namespace | mixed | |
|
||||
| rule | null|mixed | |
|
||||
| return_path_value | bool | |
|
||||
| dir | string | 目录 |
|
||||
| base_namespace | string | 基础命名空间 |
|
||||
| rule | null|mixed | 规则 |
|
||||
| return_path_value | bool | 是否返回文件路径 |
|
||||
|
||||
### 返回
|
||||
|
||||
|
||||
Reference in New Issue
Block a user