ReflectionCallback
class ReflectionCallback implements Reflector
The callback global reflector
Traits
\Reflector::export()
method
Methods
Creation of a new instance of the mother class on-the-fly
Defines the read-only properties names and accessors.
Magic setter to avoid setting read-only properties.
Magic un-setter to avoid un-setting read-only properties.
No description
Returns the original callback content
Returns the callback type
Returns the callback type (alias of self::getCallbackType()
)
Returns the reflector of the callback
Returns the function or method name if defined
Returns the class or object class name if defined
Invokes the callback with a list of parameters
Invokes the callback with a list of parameters as an array
Tests if the callback is a function
Tests if the callback is a closure
Tests if the callback is a class' method
Tests if the callback is a static class' method
Tests if the callback is a static class' method
Representation of the object
Details
in
ReflectorTrait at line 54
static
string|null
export(
mixed $argument,
bool $return = false)
Creation of a new instance of the mother class on-the-fly
Keep in mind that this method only consider the FIRST argument passed to transmit to the constructor. If your mother class requires more than one argument, you will have to over-write this method (or to not use the trait).
in
ReadOnlyPropertiesTrait at line 54
void
setReadOnlyProperties(
array $data)
Defines the read-only properties names and accessors.
Each key => value
pair of the $data
array must be constructed like:
key
is the name of the property (MUST be defined with protected access in the child class)value
is an accessor for that property: the name of the access method if it exists ortrue
for the default$obj->$key
accessor.
in
ReadOnlyPropertiesTrait at line 85
mixed
__get(
string $name)
Magic getter for read-only properties.
This will trigger a notice if the property can not be accessed.
in
ReadOnlyPropertiesTrait at line 109
void
__set(
string $name,
mixed $value)
Magic setter to avoid setting read-only properties.
in
ReadOnlyPropertiesTrait at line 125
void
__unset(
string $name)
Magic un-setter to avoid un-setting read-only properties.
at line 64
__construct(
callable $value)
at line 82
callable
getCallback()
Returns the original callback content
at line 92
int
getCallbackType()
Returns the callback type
at line 103
int
getType()
Returns the callback type (alias of self::getCallbackType()
)
at line 113
Reflector
getReflector()
Returns the reflector of the callback
at line 132
null|string
getFunctionName()
Returns the function or method name if defined
at line 142
null|string
getClassName()
Returns the class or object class name if defined
at line 152
mixed
invoke()
Invokes the callback with a list of parameters
at line 163
mixed
invokeArgs(
array $args)
Invokes the callback with a list of parameters as an array
at line 173
bool
isFunction()
Tests if the callback is a function
at line 183
bool
isClosure()
Tests if the callback is a closure
at line 193
bool
isMethod()
Tests if the callback is a class' method
at line 203
bool
isMethodStatic()
Tests if the callback is a static class' method
at line 213
bool
isObject()
Tests if the callback is a static class' method
at line 226
string
__toString()
Representation of the object
If an exception is caught, its message is returned instead of the original result (but it is not thrown ahead).