$instance
$instance : mixed
The single instance of the class
The Registry Class
Encapsulates all the necessary functions to implement a registery. Truly, at the moment, implements a paired down \ArrayObject wrapper.
CHANGELOG
1.0: Documented Registry - May 4th, 2013 2.0: Reproduced Registry for Primus - April 2nd, 2015 3.0: Reformatted for inclusion in phabstractic - July 7th, 2016
instantiate() : mixed
Gets The Singular Instance of the Singleton
This can be called with an array of 'options' (those really are supplied to the given instance). If there's an attempt to 'reconfigure' the singleton instance with new options a RuntimeException is thrown.
when instance is already defined and configured when given new configuration options
The instance of the singleton class, the class itself
get(string|integer $index) : mixed
Retrieve Registry Value
May not return reference. This returns types\Null instead of null, this allows registry values to be the native null value and still make a distinction.
string|integer | $index | The index to retrieve |
The registry value, \Phabstractic\Data\Types\None otherwise
getReference(string|integer $index) : mixed
Explicitly Retrieve Value Refernce
This will for sure return a reference to the registry value at index This returns types\Null instead of null, this allows registry values to be the native null value and make a distinction.
string|integer | $index | The index to retrieve |
The registery value reference, \Phabstractic\Data\Types\None otherwise
init(array $data = array(), mixed $flags = parent::ARRAY_AS_PROPS, string $iteratorClass = '\\ArrayIterator')
Registry Class Construction
This constructs the registry array with the given default values
array | $data | The array values to use |
mixed | $flags | The array 'flags' (such as \ArrayObject::ARRAY_AS_PROPS) |
string | $iteratorClass | The iterator class for the array, default \ArrayObject's default iterator |