fastd / generator
FastD generator
Installs: 1 041
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: >=5.5
Requires (Dev)
- phpunit/phpunit: 5.0
This package is not auto-updated.
Last update: 2024-11-09 20:56:06 UTC
README
一个写了好像没什么用的东西, 主要辅助命令行等其他工具做一个自动生成的工作.
要求
php >= 7
composer
{ "fastd/generator": "~1.1.0" }
生成对象
// include composer $generator = new \FastD\Generator\Generator('Test'); echo $generator->output();
FastD\Generator\Generator
构造方法接受三个参数,第一个是类名,第二个是命名空间,第三个是对象类型: 普通对象,抽象类,接口,可以通过 FastD\Generator\Factory\Object::OBJECT_CLASS
, FastD\Generator\Factory\Object::OBJECT_ABSTRACT
, FastD\Generator\Factory\Object::OBJECT_INTERFACE
分别控制.
具体请看: Testing
输出
class Test { }
生成文件
// include composer $generator = new \FastD\Generator\Generator('Test'); echo $generator->save(__DIR__ . '/save/Test.php');
返回生成的最终信息
不写了,具体看 测试用例.
好像瞎折腾了.