Chris@0: The ReflectionDocBlock Component [![Build Status](https://secure.travis-ci.org/phpDocumentor/ReflectionDocBlock.png)](https://travis-ci.org/phpDocumentor/ReflectionDocBlock) Chris@0: ================================ Chris@0: Chris@0: Introduction Chris@0: ------------ Chris@0: Chris@0: The ReflectionDocBlock component of phpDocumentor provides a DocBlock parser Chris@0: that is 100% compatible with the [PHPDoc standard](http://phpdoc.org/docs/latest). Chris@0: Chris@0: With this component, a library can provide support for annotations via DocBlocks Chris@0: or otherwise retrieve information that is embedded in a DocBlock. Chris@0: Chris@0: > **Note**: *this is a core component of phpDocumentor and is constantly being Chris@0: > optimized for performance.* Chris@0: Chris@0: Installation Chris@0: ------------ Chris@0: Chris@0: You can install the component in the following ways: Chris@0: Chris@0: * Use the official Github repository (https://github.com/phpDocumentor/ReflectionDocBlock) Chris@0: * Via Composer (http://packagist.org/packages/phpdocumentor/reflection-docblock) Chris@0: Chris@0: Usage Chris@0: ----- Chris@0: Chris@0: The ReflectionDocBlock component is designed to work in an identical fashion to Chris@0: PHP's own Reflection extension (http://php.net/manual/en/book.reflection.php). Chris@0: Chris@0: Parsing can be initiated by instantiating the Chris@0: `\phpDocumentor\Reflection\DocBlock()` class and passing it a string containing Chris@0: a DocBlock (including asterisks) or by passing an object supporting the Chris@0: `getDocComment()` method. Chris@0: Chris@0: > *Examples of objects having the `getDocComment()` method are the Chris@0: > `ReflectionClass` and the `ReflectionMethod` classes of the PHP Chris@0: > Reflection extension* Chris@0: Chris@0: Example: Chris@0: Chris@0: $class = new ReflectionClass('MyClass'); Chris@0: $phpdoc = new \phpDocumentor\Reflection\DocBlock($class); Chris@0: Chris@0: or Chris@0: Chris@0: $docblock = <<