class Once (View source)

Properties

static protected Once|null $instance

The current globally used instance.

static protected bool $enabled

Indicates if the once instance is enabled.

Methods

void
__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

protected void __construct(WeakMap $values)

Create a new once instance.

Parameters

WeakMap $values

Return Value

void

static Once instance()

Create a new once instance.

Return Value

Once

mixed value(Onceable $onceable)

Get the value of the given onceable.

Parameters

Onceable $onceable

Return Value

mixed

static void enable()

Re-enable the once instance if it was disabled.

Return Value

void

static void disable()

Disable the once instance.

Return Value

void

static void flush()

Flush the once instance.

Return Value

void