NullDispatcher
class NullDispatcher implements Dispatcher (View source)
Traits
Properties
protected Dispatcher | $dispatcher | The underlying event dispatcher instance. |
Methods
Forward a method call to the given object.
Throw a bad method call exception for the given method.
Don't fire an event.
Don't register an event and payload to be fired later.
Don't dispatch an event.
Determine if a given event has listeners.
Register an event subscriber with the dispatcher.
Flush a set of pushed events.
Remove a set of listeners from the dispatcher.
Forget all of the queued listeners.
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.
static protected void
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.
array|null
until(string|object $event, mixed $payload = [])
Don't dispatch an event.
void
listen(string|array $events, Closure|string $listener)
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.