ali-eltaweel/attr-action

There is no license information available for the latest version (1.0.0) of this package.

PHP attributes extraction

1.0.0 2025-06-15 05:23 UTC

This package is auto-updated.

Last update: 2025-06-15 17:24:24 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));