1 The ReflectionDocBlock Component [![Build Status](https://secure.travis-ci.org/phpDocumentor/ReflectionDocBlock.png)](https://travis-ci.org/phpDocumentor/ReflectionDocBlock)
2 ================================
7 The ReflectionDocBlock component of phpDocumentor provides a DocBlock parser
8 that is 100% compatible with the [PHPDoc standard](http://phpdoc.org/docs/latest).
10 With this component, a library can provide support for annotations via DocBlocks
11 or otherwise retrieve information that is embedded in a DocBlock.
13 > **Note**: *this is a core component of phpDocumentor and is constantly being
14 > optimized for performance.*
19 You can install the component in the following ways:
21 * Use the official Github repository (https://github.com/phpDocumentor/ReflectionDocBlock)
22 * Via Composer (http://packagist.org/packages/phpdocumentor/reflection-docblock)
27 The ReflectionDocBlock component is designed to work in an identical fashion to
28 PHP's own Reflection extension (http://php.net/manual/en/book.reflection.php).
30 Parsing can be initiated by instantiating the
31 `\phpDocumentor\Reflection\DocBlock()` class and passing it a string containing
32 a DocBlock (including asterisks) or by passing an object supporting the
33 `getDocComment()` method.
35 > *Examples of objects having the `getDocComment()` method are the
36 > `ReflectionClass` and the `ReflectionMethod` classes of the PHP
37 > Reflection extension*
41 $class = new ReflectionClass('MyClass');
42 $phpdoc = new \phpDocumentor\Reflection\DocBlock($class);
46 $docblock = <<<DOCBLOCK
48 * This is a short description.
50 * This is a *long* description.
56 $phpdoc = new \phpDocumentor\Reflection\DocBlock($docblock);