glueapps / annotations
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/glueapps/annotations
Requires
- php: >=7.1
Requires (Dev)
- phpunit/phpunit: ^7.1
This package is auto-updated.
Last update: 2025-09-29 02:02:27 UTC
README
$ composer require glueapps/annotations
Usage
<?php use GlueApps\Annotations\Parser; $text = ' @Annotation1 @Annotation2() @Annotation3(attr1="val1", attr2="val2") '; $annotations = (new Parser)->parse($text); $annotation1 = $annotations[0]; $annotation2 = $annotations[1]; $annotation3 = $annotations[2]; $annotation1->getName(); // Annotation1 $annotation1->getAttributes(); // [] $annotation2->getName(); // Annotation2 $annotation2->getAttributes(); // [] $annotation3->getName(); // Annotation3 $annotation3->getAttributes(); // ['attr1' => 'val1', 'attr2' => 'val2'] $annotation3->getAttribute('attr1'); // val1