fastd / annotation
Fastd Annotation
Installs: 956
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 3
Open Issues: 0
pkg:composer/fastd/annotation
Requires
- php: >=7.0
Requires (Dev)
- phpunit/phpunit: 5.0
This package is not auto-updated.
Last update: 2025-09-27 23:52:25 UTC
README
简单的 PHP 类注释解析类
要求
- PHP 5.6+
Composer
composer require "fastd/annotation"
使用
use FastD\Annotation\Reader; use Tests\AnnotationsClasses\IndexController; $reader = new Reader(); /** * Class IndexController * @package Tests\AnnotationsClasses * * @name foo * @json ["abc"] * @directive("test") * @route("/") * @Tests\AnnotationsClasses\AnnotationObject -> test() */ $annotation = $reader->getAnnotations(IndexController::class); $annotation->get('name'); // foo $annotation->get('json'); // [ 'ab' ]
继承与覆盖
变量同名会覆盖 "父类" 的变量和函数。
Testing
phpunit