Once
class Once
Constants
| protected INSTANCE_CONTEXT_KEY |
The context key for the current once instance. |
| protected ENABLED_CONTEXT_KEY |
The context key for the once enabled flag. |
Methods
__construct(WeakMap $values)
Create a new once instance.
bool
usesSameObjects(array $references, array $objects)
Determine if the cached references still point to the given objects.
static void
enable()
Re-enable the once instance if it was disabled.
static void
disable()
Disable the once instance.
static void
flush()
Flush the once instance.
Details
at line 28
protected
__construct(WeakMap $values)
Create a new once instance.
at line 35
static Once
instance()
Create a new once instance.
at line 43
mixed
value(Onceable $onceable)
Get the value of the given onceable.
at line 81
protected bool
usesSameObjects(array $references, array $objects)
Determine if the cached references still point to the given objects.
Object hashes are based on object IDs, which PHP reuses once an object is destroyed.
at line 95
static void
enable()
Re-enable the once instance if it was disabled.
at line 103
static void
disable()
Disable the once instance.
at line 111
static void
flush()
Flush the once instance.