ReflectionArray
class ReflectionArray extends AbstractReflectionValue
The array value 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
Representation of the object
Returns the full array itself
Returns the keys of the array
Returns the values of the array
Returns the length of the array
Test if a key exists in the array
Get a specific item of the array
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 54
__construct(
mixed $value,
int $flag = ValueType::MODE_STRICT)
at line 138
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).
in
AbstractReflectionValue at line 81
mixed
getValue()
Returns the current value
in
AbstractReflectionValue at line 91
string
getValueType()
Returns the type of the value
at line 72
array
getArray()
Returns the full array itself
at line 82
array
getKeys()
Returns the keys of the array
at line 92
array
getValues()
Returns the values of the array
at line 102
int
getLength()
Returns the length of the array
at line 113
bool
hasKey(
string|int $index)
Test if a key exists in the array
at line 124
mixed
getItem(
string|int $index)
Get a specific item of the array