xylemical / code-php
A PHP code generation library.
dev-master
2022-06-30 05:44 UTC
Requires
- php: >7.4
- xylemical/code: dev-master
- xylemical/code-processor: dev-master
- xylemical/code-validator: dev-master
Requires (Dev)
- xylemical/code-writer-twig: dev-master
- xylemical/composer-dev-bundle: ^0.1.1
This package is auto-updated.
Last update: 2025-03-29 01:03:55 UTC
README
Code writer for PHP.
Install
The recommended way to install this library is through composer.
composer require xylemical/code-php
Usage
Example writer using twig (requires xylemical/code-writer-twig
):
<?php use Xylemical\Code\Writer\Twig\TwigRender; // Structure as created via xylemical/code documentation. $class = ...; $loader = new PhpTwigLoader(); $twig = new Environment($loader, ['debug' => TRUE]); $twig->addExtension(new DebugExtension()); $twig->addExtension(new PhpTwigExtension()); $engine = new TwigRender($twig); echo $engine->render($class);
License
MIT, see LICENSE.