Download the PHP package fivepercent/reflection without Composer
On this page you can find all versions of the php package fivepercent/reflection. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download fivepercent/reflection
More information about fivepercent/reflection
Files in fivepercent/reflection
Download fivepercent/reflection
More information about fivepercent/reflection
Files in fivepercent/reflection
Vendor fivepercent
Package reflection
Short Description Reflection helpers
License MIT
Package reflection
Short Description Reflection helpers
License MIT
Keywords reflectionannotation reader
Please rate this library. Is it a good library?
Informations about the package reflection
Reflection Helper
This package add helper methods for work with PHP Reflection
Installation
Add FivePercent/Reflection in your composer.json:
{
"require": {
"fivepercent/reflection": "~1.0"
}
}
Now tell composer to download the library by running the command:
$ php composer.phar update fivepercent/reflection
Basic usage
The class FivePercent\Component\Reflection\Reflection
is final, and can not use as object.
All methods in this class statically.
Examples for work with this package:
use FivePercent\Component\Reflection\Reflection
// Get class reflection
$reflection = Reflection::loadClassReflection('MyClass');
// Get method reflection
$reflection = Reflection::loadMethodReflection('MyClass', 'myMethod');
// Get object reflection
$object = new MyClass();
$reflection = Reflection::loadObjectReflection($object);
// Get all properties from class
$properties = Reflection::getClassProperties('MyClass');
// Get all properties from class with gets from parents classes
$properties = Reflection::getClassProperties('MyClass', true);
// Get only private properties from class
$properties = Reflection::getClassProperties('MyClass', false, \ReflectionProperty::IS_PRIVATE);
// Set value to property in object
$object = new MyClass();
Reflection::setPropertyValue($object, 'myProperty', 'FooBar');
// Get value from property
$object = new MyClass();
$value = Reflection::getPropertyValue($object, 'myProperty');
All versions of reflection with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.4
The package fivepercent/reflection contains the following files
Loading the files please wait ....