Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

flexicsystems/attribute-reader

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

22 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“– Attribute Reader

Reader to get attributes from a class, method or property.


Installation

Run

composer require flexic/attribute-reader

to install flexic/attribute-reader.


Get Attributes

$reflectionClass = new \ReflectionClass(MyClass::class);

$attributeReader = new Flexic\Attributes\Reader();

$attributeReader->getAttributes($reflectionClass); // Returns list of given attributes
$attributeReader->getAttribute($reflectionClass, MyAttribute::class); // Returns first attribute of given type
$attributeReader->hasAttribute($reflectionClass, MyAttribute::class); // Checks if attribute is defined on class.
$attributeReader->findClassesWithAttribute(MyAttribute::class); // Get all classes where Attribute is defined.

License

This package is licensed using the GNU License.

Please have a look at LICENSE.md.


Donate

About

๐Ÿ“– Provides a reader for php attributes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published
Morty Proxy This is a proxified and sanitized view of the page, visit original site.