@@ -10,16 +10,12 @@ that is 100% compatible with the [PHPDoc standard](http://phpdoc.org/docs/latest
10
10
With this component, a library can provide support for annotations via DocBlocks
11
11
or otherwise retrieve information that is embedded in a DocBlock.
12
12
13
- > ** Note** : * this is a core component of phpDocumentor and is constantly being
14
- > optimized for performance.*
15
-
16
13
Installation
17
14
------------
18
15
19
- You can install the component in the following ways:
20
-
21
- * Use the official Github repository (https://github.com/phpDocumentor/ReflectionDocBlock )
22
- * Via Composer (http://packagist.org/packages/phpdocumentor/reflection-docblock )
16
+ ``` bash
17
+ composer require phpdocumentor/reflection-docblock
18
+ ```
23
19
24
20
Usage
25
21
-----
@@ -52,18 +48,20 @@ $docblock = $factory->create($docComment);
52
48
```
53
49
54
50
The ` create ` method will yield an object of type ` \phpDocumentor\Reflection\DocBlock `
55
- whose methods can be queried as shown in the following example.
51
+ whose methods can be queried:
56
52
57
53
``` php
58
- // Should contain the summary for this DocBlock
54
+ // Contains the summary for this DocBlock
59
55
$summary = $docblock->getSummary();
60
56
61
- // Contains an object of type \phpDocumentor\Reflection\DocBlock\Description;
62
- // you can either cast it to string or use the render method to get a string
63
- // representation of the Description.
57
+ // Contains \phpDocumentor\Reflection\DocBlock\Description object
64
58
$description = $docblock->getDescription();
65
- ```
66
59
67
- > For more examples it would be best to review the scripts in the ` /examples `
68
- > folder.
60
+ // You can either cast it to string
61
+ $description = (string) $docblock->getDescription();
62
+
63
+ // Or use the render method to get a string representation of the Description.
64
+ $description = $docblock->getDescription()->render();
65
+ ```
69
66
67
+ > For more examples it would be best to review the scripts in the [ ` /examples ` folder] ( /examples ) .
0 commit comments