leaditin / annotations
用于从PHP类中读取任何类型注释的简单API
1.0.2
2017-11-24 20:11 UTC
Requires
- php: ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.0
- phpunit/phpunit: ^5.7 || ^6.0
This package is auto-updated.
Last update: 2024-09-04 18:07:43 UTC
README
用于从PHP类中读取任何类型注释的简单API
安装
推荐的安装方法是使用 Composer。运行以下命令来安装最新版本的包并将其添加到项目的 composer.json
composer require leaditin/annotations
使用方法
实例化您首选的存储来读取项目中任何类的文档块数据。
$collector = new \Leaditin\Annotations\Collector\MemoryCollector( new \Leaditin\Annotations\Reader\ReflectionReader() ); $reflection = $collector->read(\Leaditin\Annotations\Reflection::class); foreach ($reflection->getClassAnnotations() as $annotation) { printf('@%s %s%s', $annotation->getName(), $annotation->getArgument(0), PHP_EOL ); }
鸣谢
许可证
在MIT许可证下发布 - 详细信息请参阅许可证文件