Skip to content

Instantly share code, notes, and snippets.

@dhrrgn
Created April 28, 2011 05:22
Show Gist options
  • Save dhrrgn/945851 to your computer and use it in GitHub Desktop.
Save dhrrgn/945851 to your computer and use it in GitHub Desktop.
A lightweight, fast Annotations parser for PHP, extends PHP's Reflection classes.
<pre><?php
include 'Annotated/ReflectionClass.php';
include 'TestClass.php';
$refClass = new Annotated\ReflectionClass('TestClass');
$docComment = $refClass->getDocComment();
var_dump($docComment->getAttributes());
echo "\n".$docComment->getLongDescription();
?></pre>
array(3) {
["package"]=>
string(9) "Annotated"
["subpackage"]=>
string(4) "Test"
["author"]=>
string(12) "Dan Horrigan"
}
This is just a test class for the Annotated\ReflectionClass
to use.
Foo::bar();
<?php
/**
* TestClass
*
* This is just a test class for the Annotated\ReflectionClass
* to use.
*
* Foo::bar();
*
* @package Annotated
* @subpackage Test
* @author Dan Horrigan
*/
class TestClass {
}
@ichohdry
Copy link

where to download 'Annotated/ReflectionClass.php' please ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment