class NullDispatcher implements Dispatcher (View source)

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.

void
__construct(Dispatcher $dispatcher)

Create a new event dispatcher instance that does not fire.

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

Don't fire an event.

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

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

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

Don't dispatch an event.

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

Register an event listener 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 of the queued listeners.

mixed
__call(string $method, array $parameters)

Dynamically pass method calls to the underlying dispatcher.

Details

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

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

static protected never throwBadMethodCallException(string $method)

Throw a bad method call exception for the given method.

Parameters

string $method

Return Value

never

Exceptions

BadMethodCallException

void __construct(Dispatcher $dispatcher)

Create a new event dispatcher instance that does not fire.

Parameters

Dispatcher $dispatcher

Return Value

void

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

Don't fire an event.

Parameters

string|object $event
mixed $payload
bool $halt

Return Value

array|null

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

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

Parameters

string $event
array $payload

Return Value

void

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

Don't dispatch an event.

Parameters

string|object $event
mixed $payload

Return Value

mixed

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

Register an event listener with the dispatcher.

Parameters

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

Return Value

void

bool hasListeners(string $eventName)

Determine if a given event has listeners.

Parameters

string $eventName

Return Value

bool

void subscribe(object|string $subscriber)

Register an event subscriber with the dispatcher.

Parameters

object|string $subscriber

Return Value

void

void flush(string $event)

Flush a set of pushed events.

Parameters

string $event

Return Value

void

void forget(string $event)

Remove a set of listeners from the dispatcher.

Parameters

string $event

Return Value

void

void forgetPushed()

Forget all of the queued listeners.

Return Value

void

mixed __call(string $method, array $parameters)

Dynamically pass method calls to the underlying dispatcher.

Parameters

string $method
array $parameters

Return Value

mixed

Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.