PHPackages                             ergebnis/attribute-collector - 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. ergebnis/attribute-collector

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

ergebnis/attribute-collector
============================

Provides collectors for collecting attributes located on classes, class constants, properties, methods, method parameters, functions, function parameters, and constants.

0.1.0(2mo ago)461MITPHPPHP ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0

Since Feb 13Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/ergebnis/attribute-collector)[ Packagist](https://packagist.org/packages/ergebnis/attribute-collector)[ Docs](https://github.com/ergebnis/attribute-collector)[ RSS](/packages/ergebnis-attribute-collector/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (18)Versions (5)Used By (0)

attribute-collector
===================

[](#attribute-collector)

[![Integrate](https://github.com/ergebnis/attribute-collector/workflows/Integrate/badge.svg)](https://github.com/ergebnis/attribute-collector/actions)[![Merge](https://github.com/ergebnis/attribute-collector/workflows/Merge/badge.svg)](https://github.com/ergebnis/attribute-collector/actions)[![Release](https://github.com/ergebnis/attribute-collector/workflows/Release/badge.svg)](https://github.com/ergebnis/attribute-collector/actions)[![Renew](https://github.com/ergebnis/attribute-collector/workflows/Renew/badge.svg)](https://github.com/ergebnis/attribute-collector/actions)

[![Code Coverage](https://camo.githubusercontent.com/e5fa3c46fec3d0a39c931bf85ad97f61a9f9ff0c5a1a05496c8af0b3cf7daa46/68747470733a2f2f636f6465636f762e696f2f67682f65726765626e69732f6174747269627574652d636f6c6c6563746f722f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/ergebnis/attribute-collector)

[![Latest Stable Version](https://camo.githubusercontent.com/a7f18e23549a9412bd34f502fc666ffbdf733ae5dd5c1903c5abc84d18a48e33/68747470733a2f2f706f7365722e707567782e6f72672f65726765626e69732f6174747269627574652d636f6c6c6563746f722f762f737461626c65)](https://packagist.org/packages/ergebnis/attribute-collector)[![Total Downloads](https://camo.githubusercontent.com/2581e2b804c9be7d1593faa19aee739e46657200e46f7c10e7be367f4a46d020/68747470733a2f2f706f7365722e707567782e6f72672f65726765626e69732f6174747269627574652d636f6c6c6563746f722f646f776e6c6f616473)](https://packagist.org/packages/ergebnis/attribute-collector)[![Monthly Downloads](https://camo.githubusercontent.com/40f70066305bf41623f7bec1fa5031fe79df2b43d3a23f40e4a7c0e0d579bb92/687474703a2f2f706f7365722e707567782e6f72672f65726765626e69732f6174747269627574652d636f6c6c6563746f722f642f6d6f6e74686c79)](https://packagist.org/packages/ergebnis/attribute-collector)

This project provides a [`composer`](https://getcomposer.org) package with collectors for collecting [attributes](https://www.php.net/manual/en/language.attributes.overview.php) located on classes, class constants, properties, methods, method parameters, functions, function parameters, and constants.

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

[](#installation)

Run

```
composer require ergebnis/attribute-collector
```

Usage
-----

[](#usage)

Attributes
----------

[](#attributes)

This package provides an `Attribute` that composes the [location](#locations) of an attribute and a concrete instance of the attribute collected at that location.

You can obtain an `Attribute` from an [attribute collection](#attribute-collection) by using a [collector](#collectors) to collect attributes.

Attribute Collection
--------------------

[](#attribute-collection)

This package provides an `AttributeCollection` that composes a collection of [attributes](#attributes).

You can obtain an `AttributeCollection` by using a [collector](#collectors) to collect attributes.

### Filtering an attribute collection by attribute class name

[](#filtering-an-attribute-collection-by-attribute-class-name)

You can filter an attribute collection by attribute class name:

```
