gephart/annotation

Gephart Annotation Component

Installs: 626

Dependents: 4

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/gephart/annotation

0.5.1 2024-06-12 11:38 UTC

This package is auto-updated.

Last update: 2025-09-12 15:37:38 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"]