devsdmf / annotations
A simple and directly handler for docblock and annotations for PHP
Installs: 4 043
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 1
Open Issues: 2
Requires
- php: >=5.4
Requires (Dev)
- fabpot/php-cs-fixer: 0.5.*
- phpunit/phpunit: 4.2.*
This package is auto-updated.
Last update: 2024-10-29 04:36:25 UTC
README
A simple and directly handler for docblock and annotations for PHP
Installation
Just add the following dependency line to your composer.json file:
{ "require": { "devsdmf/annotations": "1.*" } }
Usage
use Devsdmf\Annotations\Reader; use ReflectionClass; $reflector = new ReflectionClass('MyClass'); $reader = new Reader(); $annotation = $reader->getClassAnnotations($reflector);
The example above work with the most of Reflector interface implementations, see the available adapters below.
Adapters
- ReflectionClass
- ReflectionFunction
- ReflectionMethod
- ReflectionObject
- ReflectionProperty
Tests
To run the test suite, you need install the require-dev dependencies:
$ composer install --dev
$ ./vendor/bin/phpunit
License
This library is licensed under the MIT license.