ju1ius/luigi
最新稳定版本:1.0
Composer 安装命令:
composer require ju1ius/luigi
包简介
Need to generate PHP code? Luigi does the plumbing!
README 文档
README
Need to generate PHP code? Luigi does the plumbing!
Installation
composer require ju1ius/luigi
Basic usage
use ju1ius\Luigi\CodeBuilder; $code = CodeBuilder::create(); // The `raw` method adds verbatim code $code->raw("return [\n"); // The `indent` method increases the indent level $code->indent(); // The `write` does the same as `raw` but respects the indent level $code->write("42,\n"); // The `writeln` method does the same as `write`, but adds a newline character after each argument. $code->writeln('33,', '66,'); // The `dedent` method decreases the indent level $code->dedent(); $code->writeln('];'); // CodeBuilder implements the `Stringable` interface echo $code;
This is the expected output:
return [ 42, 33, 66, ];
统计信息
- 总下载量: 1.61k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-02-05