Skip to content

Commit 03b7048

Browse files
TomasVotrubajaapio
authored andcommitted
README: improve install and examples
1 parent 8959be6 commit 03b7048

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,12 @@ that is 100% compatible with the [PHPDoc standard](http://phpdoc.org/docs/latest
1010
With this component, a library can provide support for annotations via DocBlocks
1111
or otherwise retrieve information that is embedded in a DocBlock.
1212

13-
> **Note**: *this is a core component of phpDocumentor and is constantly being
14-
> optimized for performance.*
15-
1613
Installation
1714
------------
1815

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+
```
2319

2420
Usage
2521
-----
@@ -52,18 +48,20 @@ $docblock = $factory->create($docComment);
5248
```
5349

5450
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:
5652

5753
```php
58-
// Should contain the summary for this DocBlock
54+
// Contains the summary for this DocBlock
5955
$summary = $docblock->getSummary();
6056

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
6458
$description = $docblock->getDescription();
65-
```
6659

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+
```
6966

67+
> For more examples it would be best to review the scripts in the [`/examples` folder](/examples).

0 commit comments

Comments
 (0)