mirko-pagliai / reflection
A trait for Reflection
Installs: 9 478
Dependents: 3
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Requires
- php: >=5.5.9
Requires (Dev)
- cakephp/cakephp-codesniffer: ^3.0
- phpunit/phpunit: ^5.7|^6.0
This package is not auto-updated.
Last update: 2022-02-01 13:03:43 UTC
README
Starting April 2018 and 1.0.3 version, this repository has been abandoned.
See instead: mirko-pagliai/php-tools.
Reflection
This package contains the ReflectionTrait
, a trait that works as a wrapper for
the Reflection
classes provided by PHP, and allows you to easily:
- invoke protected or private methods;
- set/get protected or private properties.
This trait comes to test protected and private methods and properties with PHPUnit.
See tests
for examples.
In the code we can access (and test) faster to the protected and private methods
and properties that are declared in the Example
class.
Available methods are:
invokeMethod(&$object, $methodName, array $parameters = [])
getProperty(&$object, $propertyName)
setProperty(&$object, $propertyName, $propertyValue)
Versioning
For transparency and insight into our release cycle and to maintain backward compatibility, Reflection will be maintained under the Semantic Versioning guidelines.