Documentation

Dispatcher

Table of Contents

dispatch()  : array<string|int, mixed>|null
Dispatch an event and call the listeners.
flush()  : void
Flush a set of pushed events.
forget()  : void
Remove a set of listeners from the dispatcher.
forgetPushed()  : void
Forget all of the queued listeners.
hasListeners()  : bool
Determine if a given event has listeners.
listen()  : void
Register an event listener with the dispatcher.
push()  : void
Register an event and payload to be fired later.
subscribe()  : void
Register an event subscriber with the dispatcher.
until()  : array<string|int, mixed>|null
Dispatch an event until the first non-null response is returned.

Methods

dispatch()

Dispatch an event and call the listeners.

public dispatch(string|object $event[, mixed $payload = [] ][, bool $halt = false ]) : array<string|int, mixed>|null
Parameters
$event : string|object
$payload : mixed = []
$halt : bool = false
Return values
array<string|int, mixed>|null

flush()

Flush a set of pushed events.

public flush(string $event) : void
Parameters
$event : string
Return values
void

forget()

Remove a set of listeners from the dispatcher.

public forget(string $event) : void
Parameters
$event : string
Return values
void

forgetPushed()

Forget all of the queued listeners.

public forgetPushed() : void
Return values
void

hasListeners()

Determine if a given event has listeners.

public hasListeners(string $eventName) : bool
Parameters
$eventName : string
Return values
bool

listen()

Register an event listener with the dispatcher.

public listen(string|array<string|int, mixed> $events, mixed $listener) : void
Parameters
$events : string|array<string|int, mixed>
$listener : mixed
Return values
void

push()

Register an event and payload to be fired later.

public push(string $event[, array<string|int, mixed> $payload = [] ]) : void
Parameters
$event : string
$payload : array<string|int, mixed> = []
Return values
void

subscribe()

Register an event subscriber with the dispatcher.

public subscribe(object|string $subscriber) : void
Parameters
$subscriber : object|string
Return values
void

until()

Dispatch an event until the first non-null response is returned.

public until(string|object $event[, mixed $payload = [] ]) : array<string|int, mixed>|null
Parameters
$event : string|object
$payload : mixed = []
Return values
array<string|int, mixed>|null

Search results