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.

static Once
instance()

Create a new once instance.

mixed
value(Onceable $onceable)

Get the value of the given onceable.

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 27
protected __construct(WeakMap $values)

Create a new once instance.

Parameters

WeakMap $values

at line 34
static Once instance()

Create a new once instance.

Return Value

Once

at line 42
mixed value(Onceable $onceable)

Get the value of the given onceable.

Parameters

Onceable $onceable

Return Value

mixed

at line 66
static void enable()

Re-enable the once instance if it was disabled.

Return Value

void

at line 74
static void disable()

Disable the once instance.

Return Value

void

at line 82
static void flush()

Flush the once instance.

Return Value

void