gephart / annotation
Gephart Annotation Component
0.5
2017-10-02 16:16 UTC
Requires
- php: >=7.1
Requires (Dev)
- phpmd/phpmd: @stable
- squizlabs/php_codesniffer: 3.*
README
Dependencies
- PHP >= 7.1
Instalation
composer require gephart/annotation
Using
@AnnotationName value @AnnotationName {"or anything":"in JSON"}
/**
* @Route /home/
*/
class SuperClass
{
/**
* @Template {
* "url": "index.html"
* }
*/
public function index()
{
}
}
$reader = new \Gephart\Annotation\Reader();
$annotation = $reader->get("Route", SuperClass::class);
// /home/
$annotation = $reader->get("Template", SuperClass::class, "index);
// ["url"=>"index.html"]