Repository URL to install this package:
|
Version:
1.1.0 ▾
|
| scripts |
| src |
| tests |
| .gitignore |
| .travis.yml |
| README.md |
| phpcs.xml |
| phpunit.xml |
| composer.json |
Parses php doc blocks and makes them easily accessible.
This is based on using reflection and results should be heavily cached or only be used in processes which aren't time critical.
Run composer require crazyfactory/docblocks to install the latest version into your composer powered project.
You can pass in any doc-block formatted string into the constructor of DocBlock to have it parsed.
$dc = new DocBlock('/** myDocBlockString */');
Or you can pass in any Reflection object offering getDocComment() like ReflectionMethod, ReflectionClass etc.
$dc = new DocBlock(new \ReflectionClass(MyClass::class));
If you only care for the results in form of simple DocBlockParameter-array you can use the parser directly.
$results = DocBlock::parse($myDocBlockString);