ReflectionSource
class ReflectionSource implements Reflector
The source reflector
Traits
\Reflector::export() method
Properties
| static array | $default_context |
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 path of concerned file
Returns the concerned line number (if defined)
Returns the context or one of its items
Get the source code of the file in a line-by-line array
Renders the source as plain text
Renders the source highlighted in HTML
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:
keyis the name of the property (MUST be defined with protected access in the child class)valueis an accessor for that property: the name of the access method if it exists ortruefor the default$obj->$keyaccessor.
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 90
__construct(
string $file_path,
null $lineno = null,
array $context = null)
at line 116
string
getFilePath()
Returns the path of concerned file
at line 126
int|null
getLineNo()
Returns the concerned line number (if defined)
at line 137
array|mixed
getContext(
null $item = null)
Returns the context or one of its items
at line 154
mixed
getSource()
Get the source code of the file in a line-by-line array
The keys of the items are the line numbers, and a special on key
is used if a line exists in the trace: on => line number.
at line 199
string
render(
bool $return = false,
bool $info = false)
Renders the source as plain text
at line 220
string
renderHighlight(
bool $return = false,
bool $info = false)
Renders the source highlighted in HTML
at line 268
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).