leaditin / annotations
A simple API for reading any kind of annotations from PHP Class
Installs: 23
Dependents: 0
Suggesters: 0
Security: 0
Stars: 4
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/leaditin/annotations
Requires
- php: ^7.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.0
- phpunit/phpunit: ^5.7 || ^6.0
This package is auto-updated.
Last update: 2025-10-04 20:39:01 UTC
README
A simple API for reading any kind of annotations from PHP Class
Installation
The preferred method of installation is via Composer. Run the following command to install the latest version of a package and add it to your project's composer.json
:
composer require leaditin/annotations
Usage
Instantiate your preferred storage to read doc block data of any Class in your project.
$collector = new \Leaditin\Annotations\Collector\MemoryCollector( new \Leaditin\Annotations\Reader\ReflectionReader() ); $reflection = $collector->read(\Leaditin\Annotations\Reflection::class); foreach ($reflection->getClassAnnotations() as $annotation) { printf('@%s %s%s', $annotation->getName(), $annotation->getArgument(0), PHP_EOL ); }
Credits
License
Released under MIT License - see the License File for details.