ReflectionHelper
Testing helper.
Table of Contents
Methods
- getPrivateMethodInvoker() : Closure
- Find a private method invoker.
- getPrivateProperty() : mixed
- Retrieve a private property.
- setPrivateProperty() : void
- Set a private property.
- getAccessibleRefProperty() : ReflectionProperty
- Find an accessible property.
Methods
getPrivateMethodInvoker()
Find a private method invoker.
public
static getPrivateMethodInvoker(object|string $obj, string $method) : Closure
Parameters
- $obj : object|string
-
object or class name
- $method : string
-
method name
Tags
Return values
ClosuregetPrivateProperty()
Retrieve a private property.
public
static getPrivateProperty(object|string $obj, string $property) : mixed
Parameters
- $obj : object|string
-
object or class name
- $property : string
-
property name
Tags
setPrivateProperty()
Set a private property.
public
static setPrivateProperty(object|string $obj, string $property, mixed $value) : void
Parameters
- $obj : object|string
-
object or class name
- $property : string
-
property name
- $value : mixed
-
value
Tags
getAccessibleRefProperty()
Find an accessible property.
private
static getAccessibleRefProperty(object|string $obj, string $property) : ReflectionProperty
Parameters
- $obj : object|string
- $property : string