phasync
Event / once

Method

Event::once

Calls $listeners the next time the event triggers, and not after.

Description#

public Event::once(
    Closure ...$listeners
): void

Parameters#

...$listeners Closure

See also#

  • Event::listenCalls $listeners every time the event triggers.
  • Event::offRemoves $listeners, whether they were added with listen() or once().