Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JanHuang/annotation
Fastd Annotation
https://github.com/JanHuang/annotation
Last synced: 28 days ago
JSON representation
Fastd Annotation
- Host: GitHub
- URL: https://github.com/JanHuang/annotation
- Owner: fastdlabs
- License: mit
- Created: 2015-11-27T04:12:44.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-11T14:16:46.000Z (almost 8 years ago)
- Last Synced: 2024-08-24T05:01:25.757Z (5 months ago)
- Language: PHP
- Homepage:
- Size: 83 KB
- Stars: 5
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Annotation
![Building](https://api.travis-ci.org/JanHuang/annotation.svg?branch=master)
[![Latest Stable Version](https://poser.pugx.org/fastd/annotation/v/stable)](https://packagist.org/packages/fastd/annotation) [![Total Downloads](https://poser.pugx.org/fastd/annotation/downloads)](https://packagist.org/packages/fastd/annotation) [![Latest Unstable Version](https://poser.pugx.org/fastd/annotation/v/unstable)](https://packagist.org/packages/fastd/annotation) [![License](https://poser.pugx.org/fastd/annotation/license)](https://packagist.org/packages/fastd/annotation)简单的 PHP 类注释解析类
## 要求
* PHP 5.6+
## Composer
```json
composer require "fastd/annotation"
```## 使用
```php
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
```php
phpunit
```## License MIT