[主页] 一款具有高度主观性的 PHP 代码生成库
Memio is a library, it allows you to describe PHP code by building "Model" classes
(e.g. new Method('__construct')) and then to generate it using a PrettyPrinter!
Note: The actual generation logic is held in Twig templates. If the coding style provided doesn't appeal to you, you can overwrite those templates easily.
Install using Composer:
$ composer require memio/memio:^3.0We're going to generate a class with a constructor and two attributes:
…With this simple example, we get the following output:
<?php
namespace Vendor\Project;
class MyService
{
private $createdAt;
private $filename;
public function __construct(DateTime $createdAt, string $filename)
{
}
}Memio can be quite powerful, discover how by reading the docs:
You can see the current and past versions using one of the following:
git tag commandAnd finally some meta documentation:
暂无开放 Issues,或尚未同步最近议题。