PHPackages                             rkr/attribute-provider - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rkr/attribute-provider

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rkr/attribute-provider
======================

A lightweight PHP utility for simplifying the retrieval of attributes using reflection.

00PHPCI passing

Since Mar 8Pushed 1y ago1 watchersCompare

[ Source](https://github.com/rkrx/php-attribute-provider)[ Packagist](https://packagist.org/packages/rkr/attribute-provider)[ RSS](/packages/rkr-attribute-provider/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

php-attribute-provider
======================

[](#php-attribute-provider)

A lightweight PHP utility for simplifying the retrieval of attributes using reflection.

Installation
------------

[](#installation)

```
composer require rkr/attribute-provider
```

Example Usage
-------------

[](#example-usage)

```
use Kir\Attributes\ClassAttributeProviderFactory;
use Kir\Attributes\Subjects\ClassAttribute;
use Kir\Attributes\Subjects\MethodAttribute;
use Kir\Attributes\Subjects\PropertyAttribute;
use Kir\Attributes\Subjects\TestClass1;

$factory = new ClassAttributeProviderFactory();
$provider = $factory->create(TestClass1::class);

$reflectionAttributes = $provider->getAllReflectionAttributes(ClassAttribute::class);
foreach ($reflectionAttributes as $reflectionAttribute) {
	$instance = $reflectionAttribute->newInstance();
	printf("Attribute %s of %s -> %s: %s%s", $instance::class, TestClass1::class, $instance->key, $instance->value, PHP_EOL);
}

$reflectionAttributes = $provider->properties()->getFirstAttributesFromPropertiesWithPropertyNameAsKey(PropertyAttribute::class);
foreach ($reflectionAttributes as $propertyName => $instance) {
	printf("Attribute %s of %s -> %s: %s%s", $instance::class, $propertyName, $instance->key, $instance->value, PHP_EOL);
}

$reflectionAttributes = $provider->methods()->getFirstAttributesFromMethodsWithMethodNameAsKey(MethodAttribute::class);
foreach ($reflectionAttributes as $propertyName => $instance) {
	printf("Attribute %s of %s -> %s: %s%s", $instance::class, $propertyName, $instance->key, $instance->value, PHP_EOL);
}
```

###  Health Score

14

—

LowBetter than 2% of packages

Maintenance34

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity15

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f83d7e57a4bf3f1309680dbfbbf2d022f0ee6dae64a4b3bdfbed1226f2f6bef?d=identicon)[rkr](/maintainers/rkr)

---

Top Contributors

[![rkrx](https://avatars.githubusercontent.com/u/5672982?v=4)](https://github.com/rkrx "rkrx (7 commits)")

### Embed Badge

![Health badge](/badges/rkr-attribute-provider/health.svg)

```
[![Health](https://phpackages.com/badges/rkr-attribute-provider/health.svg)](https://phpackages.com/packages/rkr-attribute-provider)
```

###  Alternatives

[commerceguys/enum

A PHP 5.4+ enumeration library.

961.9M7](/packages/commerceguys-enum)[symfony/ux-svelte

Integration of Svelte in Symfony

30117.0k](/packages/symfony-ux-svelte)[danog/better-prometheus

A better Prometheus library for PHP applications

13179.5k2](/packages/danog-better-prometheus)[nwogu/bagpack

Organize your migration files into proper directories by tables

271.4k](/packages/nwogu-bagpack)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
