gephart/annotation

Gephart Annotation Component

0.5.1 2024-06-12 11:38 UTC

This package is auto-updated.

Last update: 2024-07-12 13:19:51 UTC


README

php

Dependencies

  • PHP >= 7.4

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"]