ali-eltaweel / attr-action
PHP attributes extraction
Installs: 96
Dependents: 6
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/ali-eltaweel/attr-action
Requires
- php: ^8.1
This package is auto-updated.
Last update: 2025-10-15 17:58:34 UTC
README
PHP Attributes Extraction.
Installation
Install attr-action via Composer:
composer require ali-eltaweel/attr-action
Usage
use Attraction\Annotation; #[Attribute] class Mark extends Annotation {} #[Attribute(Attribute::TARGET_CLASS|Attribute::IS_REPEATABLE)] class RepeatableMark extends Annotation {}
#[Mark] class Target {} #[RepeatableMark] #[RepeatableMark] class AnotherTarget {}
/** @var Mark */ $mark = Mark::annotatedOn(new ReflectionClass(Target::class)); /** @var RepeatableMark[] */ $marks = RepeatableMark::annotatedOn(new ReflectionClass(AnotherTarget::class));