From 8bb4421a705e2225f58268daea1d8256a8ef57a8 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sun, 5 Mar 2023 11:52:41 +0800 Subject: [PATCH] update text generate command --- docs/components/common/class-alias.md | 2 ++ src/ZM/Command/Generate/TextGenerateCommand.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/components/common/class-alias.md b/docs/components/common/class-alias.md index 05bff127..198e63ee 100644 --- a/docs/components/common/class-alias.md +++ b/docs/components/common/class-alias.md @@ -29,6 +29,8 @@ | `\ZM\Annotation\OneBot\CommandArgument` | `CommandArgument` | | `\ZM\Annotation\OneBot\CommandHelp` | `CommandHelp` | | `\ZM\Annotation\Closed` | `Closed` | +| `\ZM\Middleware\MiddlewareArgTrait` | `MiddlewareArgTrait` | +| `\ZM\Middleware\Pipeline` | `Pipeline` | | `\ZM\Plugin\ZMPlugin` | `ZMPlugin` | | `\ZM\Context\BotContext` | `BotContext` | | `\ZM\Utils\ZMRequest` | `ZMRequest` | diff --git a/src/ZM/Command/Generate/TextGenerateCommand.php b/src/ZM/Command/Generate/TextGenerateCommand.php index 45e934dc..4434f1d1 100644 --- a/src/ZM/Command/Generate/TextGenerateCommand.php +++ b/src/ZM/Command/Generate/TextGenerateCommand.php @@ -63,8 +63,8 @@ class TextGenerateCommand extends Command LINE; file_put_contents( SOURCE_ROOT_DIR . '/docs/components/common/class-alias.md', - $obj . "\n" . '| ' . str_pad('全类名', $full_maxlen) . ' | ' . str_pad('别名', $short_maxlen) . ' |' . - "\n" . '| ' . str_pad('', $full_maxlen, '-') . ' | ' . str_pad('', $short_maxlen, '-') . ' |' . + $obj . "\n" . '| ' . str_pad('全类名 ', $full_maxlen + 6) . ' | ' . str_pad('别名 ', $short_maxlen + 4) . ' |' . + "\n" . '|-' . str_pad('', $full_maxlen, '-') . '-|-' . str_pad('', $short_maxlen, '-') . '-|' . "\n" . implode("\n", array_map(fn ($v) => '| ' . str_pad('`' . $v[0] . '`', $full_maxlen) . ' | ' . str_pad('`' . $v[1] . '`', $short_maxlen) . ' |', $line)) . "\n" ); $this->write('成功');