class NullDispatcher implements Dispatcher

Traits

Properties

protected Dispatcher $dispatcher

The underlying event dispatcher instance.

Methods

mixed
forwardCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object.

mixed
forwardDecoratedCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object, returning $this if the forwarded call returned itself.

static never
throwBadMethodCallException(string $method)

Throw a bad method call exception for the given method.

__construct(Dispatcher $dispatcher)

Create a new event dispatcher instance that does not fire.

mixed
dispatch(object|string $event, mixed $payload = [], bool $halt = false)

Don't fire an event.

void
push(string $event, mixed $payload = [])

Don't register an event and payload to be fired later.

mixed
until(object|string $event, mixed $payload = [])

Don't dispatch an event.

void
listen(array|Closure|QueuedClosure|string $events, array|object|string|null $listener = null)

Register an event listener with the dispatcher.

void
observe(array|string $events, array|object|string $observer)

Register a passive event observer with the dispatcher.

bool
hasListeners(string $eventName)

Determine if a given event has listeners.

void
subscribe(object|string $subscriber)

Register an event subscriber with the dispatcher.

void
flush(string $event)

Flush a set of pushed events.

void
forget(string $event)

Remove a set of listeners from the dispatcher.

void
forgetPushed()

Forget all events queued via push() in the current coroutine.

mixed
__call(string $method, array $parameters)

Dynamically pass method calls to the underlying dispatcher.

Details

in ForwardsCalls at line 22
protected mixed forwardCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object.

Parameters

mixed $object
string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

in ForwardsCalls at line 52
protected mixed forwardDecoratedCallTo(mixed $object, string $method, array $parameters)

Forward a method call to the given object, returning $this if the forwarded call returned itself.

Parameters

mixed $object
string $method
array $parameters

Return Value

mixed

Exceptions

BadMethodCallException

in ForwardsCalls at line 66
static protected never throwBadMethodCallException(string $method)

Throw a bad method call exception for the given method.

Parameters

string $method

Return Value

never

Exceptions

BadMethodCallException

at line 23
__construct(Dispatcher $dispatcher)

Create a new event dispatcher instance that does not fire.

Parameters

Dispatcher $dispatcher

at line 31
mixed dispatch(object|string $event, mixed $payload = [], bool $halt = false)

Don't fire an event.

Parameters

object|string $event
mixed $payload
bool $halt

Return Value

mixed

at line 39
void push(string $event, mixed $payload = [])

Don't register an event and payload to be fired later.

Parameters

string $event
mixed $payload

Return Value

void

at line 46
mixed until(object|string $event, mixed $payload = [])

Don't dispatch an event.

Parameters

object|string $event
mixed $payload

Return Value

mixed

at line 54
void listen(array|Closure|QueuedClosure|string $events, array|object|string|null $listener = null)

Register an event listener with the dispatcher.

Parameters

array|Closure|QueuedClosure|string $events
array|object|string|null $listener

Return Value

void

at line 62
void observe(array|string $events, array|object|string $observer)

Register a passive event observer with the dispatcher.

Parameters

array|string $events
array|object|string $observer

Return Value

void

at line 70
bool hasListeners(string $eventName)

Determine if a given event has listeners.

Parameters

string $eventName

Return Value

bool

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

Register an event subscriber with the dispatcher.

Parameters

object|string $subscriber

Return Value

void

at line 86
void flush(string $event)

Flush a set of pushed events.

Parameters

string $event

Return Value

void

at line 94
void forget(string $event)

Remove a set of listeners from the dispatcher.

Parameters

string $event

Return Value

void

at line 102
void forgetPushed()

Forget all events queued via push() in the current coroutine.

Return Value

void

at line 110
mixed __call(string $method, array $parameters)

Dynamically pass method calls to the underlying dispatcher.

Parameters

string $method
array $parameters

Return Value

mixed