type-lang/printer
最新稳定版本:1.4.0
Composer 安装命令:
composer require type-lang/printer
包简介
Library for rendering TypeLange AST nodes into it's string representation
关键字:
README 文档
README
Reference implementation for TypeLang Printer.
Resources
Installation
TypeLang Printer is available as Composer repository and can be installed using the following command in a root of your project:
composer require type-lang/printer
Quick Start
$parser = new \TypeLang\Parser\Parser(); $type = $parser->parseType(<<<'PHP' array{ field1: (callable(Example,int):mixed), field2: list<Some>, field3: iterable<array-key, array{int, non-empty-string}>, Some::CONST_*, "\njson_flags": \JSON_*, ... } PHP); // Print Statement $native = new \TypeLang\Printer\NativeTypePrinter(); echo $native->print($type); // Expected Output: // array $phpdoc = new \TypeLang\Printer\PrettyPrinter(); echo $phpdoc->print($type); // Expected Output: // array{ // field1: callable(Example, int): mixed, // field2: list<Some>, // field3: iterable<array-key, array{ // int, // non-empty-string // }>, // Some::CONST_*, // "\njson_flags": \JSON_*, // ... // }
统计信息
- 总下载量: 32.35k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 6
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-12-16