abstract class AbstractInvokable implements InvokableInterface
Magic handling of properties access
Presentation
This model constructs an accessible object in which you can dynamically set and get properties on the fly without errors.
The visibility of properties is kept for direct set or get.
Rules
All setter methods returns the object itself for chainability.
To use static magic caller, your constructor must not require any argument.
Methods
mixed |
__invoke(string $name)
Magic getter when calling an object as a function |
|
mixed |
__call(string $name, array $arguments)
Magic handler when calling a non-existing method on an object |
|
static mixed |
__callStatic(string $name, array $arguments)
Magic handler when calling a non-eixsting method statically on an object |
|
mixed |
__get(string $name)
Magic getter |
|
AbstractInvokable |
__set(string $name, mixed $value)
Magic setter |
|
bool |
__isset(string $name)
Magic checker |
|
AbstractInvokable |
__unset(string $name)
Magic unsetter |
|
string |
findPropertyName(string $name)
Search a property name in the current object with one or tow leading underscores |
|
static string |
findPropertyNameStatic(string $name, string|object $object)
Search a property name in the current object with one or tow leading underscores |
Details
at line 68
public mixed
__invoke(string $name)
Magic getter when calling an object as a function
at line 96
public mixed
__call(string $name, array $arguments)
Magic handler when calling a non-existing method on an object
Magic method handling getProp(default)
, setProp(value)
, unsetProp()
, issetProp()
or resetProp()
.
at line 141
static public mixed
__callStatic(string $name, array $arguments)
Magic handler when calling a non-eixsting method statically on an object
Magic static handling of getProp(default)
, setProp(value)
, unsetProp()
, issetProp()
or resetProp()
.
at line 176
public mixed
__get(string $name)
Magic getter
Magic method called when $this->prop
is invoked.
at line 193
public AbstractInvokable
__set(string $name, mixed $value)
Magic setter
Magic method called when $this->arg = value
is invoked.
at line 209
public bool
__isset(string $name)
Magic checker
Magic method called when isset($this->prop)
or empty($this->prop)
are invoked.
at line 225
public AbstractInvokable
__unset(string $name)
Magic unsetter
Magic method called when unset($this->prop)
is invoked.
at line 415
public string
findPropertyName(string $name)
Search a property name in the current object with one or tow leading underscores
at line 427
static public string
findPropertyNameStatic(string $name, string|object $object)
Search a property name in the current object with one or tow leading underscores