Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Latest commit

 

History

History
27 lines (21 loc) · 453 Bytes

README.md

File metadata and controls

27 lines (21 loc) · 453 Bytes

PHP-Doc-Annotations parser

Example

<?php
use modules\phpdocannotations\Annotation;
use modules\phpdocannotations\AnnotationParser;

/**
 * @Annotation()
 */
final class TestAnnotation {
    public $key;
}

/**
 * @TestAnnotation(key = "Hello world")
 */
class Test {
}

$testClassAnnotations = new AnnotationParser(Test::class);

$testAnnotation = $testClassAnnotations->getAnnotation(TestAnnotation::class);

echo $testAnnotation->key;