Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/crazyfactory/php-docblocks
https://github.com/crazyfactory/php-docblocks
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/crazyfactory/php-docblocks
- Owner: crazyfactory
- Created: 2017-05-31T01:32:55.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-08-18T10:20:58.000Z (over 7 years ago)
- Last Synced: 2024-12-06T14:50:01.891Z (about 1 month ago)
- Language: PHP
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
php-docblocks
=======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.
## Install
Run `composer require crazyfactory/docblocks` to install the latest version into your composer powered project.
## Usage
You can pass in any doc-block formatted string into the constructor of *DocBlock* to have it parsed.
```php
$dc = new DocBlock('/** myDocBlockString */');
```Or you can pass in any Reflection object offering *getDocComment()* like *ReflectionMethod*, *ReflectionClass* etc.
```php
$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.
```php
$results = DocBlock::parse($myDocBlockString);
```## Changelog
- 2.0.0 added auto-deploy via travis CI with githubtags as version-nr.