mileschou/codegener 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mileschou/codegener

Composer 安装命令:

composer require mileschou/codegener

包简介

The helper for generate code.

README 文档

README

tests codecov Codacy Badge Latest Stable Version Total Downloads License Beerpay

The helper for generate code.

Concept

Sometimes, we need to generate many code, like Scaffold, compiled code, even document.

This package can help to write code easily.

Usage

Writer class need Laravel Filesystem, it's testable, and need instance implemented PSR-3 Logger interface.

public function __construct(Filesystem $filesystem, LoggerInterface $logger)

Use write() method to put code instantly. Codegener will overwrite when $overwrite is true.

public function write(string $path, $content, bool $overwrite = false): void

Use writeMass if need generate many code.

public function writeMass(iterable $contents, bool $overwrite = false): void

Traits

Following traits is helper for process env and path.

Example

Following is an example code.

$writer->setBasePath('/path/to/your/project');

$code = [
    'some-foo' => 'foo',
    'some-bar' => 'bar',
];

$writer->writeMass($code);

Codegener will generate two files.

$ cat /path/to/your/project/some-foo
foo
$ cat /path/to/your/project/some-bar
bar

Example Projects

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 2.47k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固