ReflectionValue
class ReflectionValue implements ReflectionValueInterface
This is the global variable value reflector object. It acts like a reflection proxy.
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 variable reflector
Returns the variable's value from the reflector
Returns the variable's type from the reflector
Tests if the variable is NULL
Tests if the variable is a boolean
Tests if the variable is an integer
Tests if the variable is a float
Tests if the variable is a string
Tests if the variable is an array
Tests if the variable is an object
Tests if the variable is a resource
Tests if the variable is a callback
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 53
__construct(
mixed $value,
int $flag = ValueType::MODE_STRICT,
array $order = null)
at line 66
mixed
getReflector()
Returns the variable reflector
at line 76
mixed
getValue()
Returns the variable's value from the reflector
at line 86
string
getValueType()
Returns the variable's type from the reflector
at line 96
bool
isNull()
Tests if the variable is NULL
at line 106
bool
isBoolean()
Tests if the variable is a boolean
at line 116
bool
isInteger()
Tests if the variable is an integer
at line 126
bool
isFloat()
Tests if the variable is a float
at line 136
bool
isString()
Tests if the variable is a string
at line 146
bool
isArray()
Tests if the variable is an array
at line 156
bool
isObject()
Tests if the variable is an object
at line 166
bool
isResource()
Tests if the variable is a resource
at line 176
bool
isCallback()
Tests if the variable is a callback
at line 189
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).