From f140784a503b394fb9778f5659377739ca73e655 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sun, 25 Dec 2022 23:19:49 +0800 Subject: [PATCH] add PHPDoc --- src/ZM/Utils/CodeGenerator/PluginGenerator.php | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ZM/Utils/CodeGenerator/PluginGenerator.php b/src/ZM/Utils/CodeGenerator/PluginGenerator.php index 3396afb3..4ff08212 100644 --- a/src/ZM/Utils/CodeGenerator/PluginGenerator.php +++ b/src/ZM/Utils/CodeGenerator/PluginGenerator.php @@ -6,13 +6,23 @@ namespace ZM\Utils\CodeGenerator; use ZM\Store\FileSystem; +/** + * Class PluginGenerator + * 插件脚手架生成器 + */ class PluginGenerator { public function __construct(private string $name, private string $plugin_dir) { } - public function generate(array $options) + /** + * 开始生成 + * + * @param array $options 传入的命令行选项 + * @return void + */ + public function generate(array $options): void { // 先检查插件目录是否存在,不存在则创建 FileSystem::createDir($this->plugin_dir); @@ -75,6 +85,9 @@ class PluginGenerator } } + /** + * 根据传入的名称,生成相应的驼峰类名 + */ public function convertClassName(): string { $name = $this->name;