mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-25 01:25:34 +08:00
add PHPDoc
This commit is contained in:
@@ -6,13 +6,23 @@ namespace ZM\Utils\CodeGenerator;
|
|||||||
|
|
||||||
use ZM\Store\FileSystem;
|
use ZM\Store\FileSystem;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Class PluginGenerator
|
||||||
|
* 插件脚手架生成器
|
||||||
|
*/
|
||||||
class PluginGenerator
|
class PluginGenerator
|
||||||
{
|
{
|
||||||
public function __construct(private string $name, private string $plugin_dir)
|
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);
|
FileSystem::createDir($this->plugin_dir);
|
||||||
@@ -75,6 +85,9 @@ class PluginGenerator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据传入的名称,生成相应的驼峰类名
|
||||||
|
*/
|
||||||
public function convertClassName(): string
|
public function convertClassName(): string
|
||||||
{
|
{
|
||||||
$name = $this->name;
|
$name = $this->name;
|
||||||
|
|||||||
Reference in New Issue
Block a user