class Dispatcher implements Dispatcher (View source)

Methods

void
__construct(Container $container = null)

Create a new event dispatcher instance.

void
listen(string|array $events, mixed $listener)

Register an event listener with the dispatcher.

bool
hasListeners(string $eventName)

Determine if a given event has listeners.

void
push(string $event, array $payload = array())

Register an event and payload to be fired later.

void
flush(string $event)

Flush a set of pushed events.

void
subscribe(object|string $subscriber)

Register an event subscriber with the dispatcher.

array|null
until(string|object $event, mixed $payload = array())

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

array|null
fire(string|object $event, mixed $payload = array(), bool $halt = false)

Fire an event and call the listeners.

array|null
dispatch(string|object $event, mixed $payload = array(), bool $halt = false)

Fire an event and call the listeners.

array
getListeners(string $eventName)

Get all of the listeners for a given event name.

mixed
makeListener(string|Closure $listener, bool $wildcard = false)

Register an event listener with the dispatcher.

createClassListener(string $listener, bool $wildcard = false)

Create a class based listener using the IoC container.

void
forget(string $event)

Remove a set of listeners from the dispatcher.

void
forgetPushed()

Forget all of the pushed listeners.

$this
setQueueResolver(callable $resolver)

Set the queue resolver implementation.

Details

at line line 51
void __construct(Container $container = null)

Create a new event dispatcher instance.

Parameters

Container $container

Return Value

void

at line line 63
void listen(string|array $events, mixed $listener)

Register an event listener with the dispatcher.

Parameters

string|array $events
mixed $listener

Return Value

void

at line line 92
bool hasListeners(string $eventName)

Determine if a given event has listeners.

Parameters

string $eventName

Return Value

bool

at line line 104
void push(string $event, array $payload = array())

Register an event and payload to be fired later.

Parameters

string $event
array $payload

Return Value

void

at line line 117
void flush(string $event)

Flush a set of pushed events.

Parameters

string $event

Return Value

void

at line line 128
void subscribe(object|string $subscriber)

Register an event subscriber with the dispatcher.

Parameters

object|string $subscriber

Return Value

void

at line line 157
array|null until(string|object $event, mixed $payload = array())

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

Parameters

string|object $event
mixed $payload

Return Value

array|null

at line line 170
array|null fire(string|object $event, mixed $payload = array(), bool $halt = false)

Fire an event and call the listeners.

Parameters

string|object $event
mixed $payload
bool $halt

Return Value

array|null

at line line 183
array|null dispatch(string|object $event, mixed $payload = array(), bool $halt = false)

Fire an event and call the listeners.

Parameters

string|object $event
mixed $payload
bool $halt

Return Value

array|null

at line line 265
array getListeners(string $eventName)

Get all of the listeners for a given event name.

Parameters

string $eventName

Return Value

array

at line line 324
mixed makeListener(string|Closure $listener, bool $wildcard = false)

Register an event listener with the dispatcher.

Parameters

string|Closure $listener
bool $wildcard

Return Value

mixed

at line line 346
Closure createClassListener(string $listener, bool $wildcard = false)

Create a class based listener using the IoC container.

Parameters

string $listener
bool $wildcard

Return Value

Closure

at line line 504
void forget(string $event)

Remove a set of listeners from the dispatcher.

Parameters

string $event

Return Value

void

at line line 518
void forgetPushed()

Forget all of the pushed listeners.

Return Value

void

at line line 543
$this setQueueResolver(callable $resolver)

Set the queue resolver implementation.

Parameters

callable $resolver

Return Value

$this