NullDispatcher
class NullDispatcher implements Dispatcher
Traits
Properties
| protected Dispatcher | $dispatcher | The underlying event dispatcher instance. |
Methods
Forward a method call to the given object.
Forward a method call to the given object, returning $this if the forwarded call returned itself.
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.
Register an event listener with the dispatcher.
Register a passive event observer with the dispatcher.
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 events queued via push() in the current coroutine.
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.
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.
in
ForwardsCalls at line 66
static protected never
throwBadMethodCallException(string $method)
Throw a bad method call exception for the given method.
at line 23
__construct(Dispatcher $dispatcher)
Create a new event dispatcher instance that does not fire.
at line 31
mixed
dispatch(object|string $event, mixed $payload = [], bool $halt = false)
Don't fire an event.
at line 39
void
push(string $event, mixed $payload = [])
Don't register an event and payload to be fired later.
at line 46
mixed
until(object|string $event, mixed $payload = [])
Don't dispatch an event.
at line 54
void
listen(array|Closure|QueuedClosure|string $events, array|object|string|null $listener = null)
Register an event listener with the dispatcher.
at line 62
void
observe(array|string $events, array|object|string $observer)
Register a passive event observer with the dispatcher.
at line 70
bool
hasListeners(string $eventName)
Determine if a given event has listeners.
at line 78
void
subscribe(object|string $subscriber)
Register an event subscriber with the dispatcher.
at line 86
void
flush(string $event)
Flush a set of pushed events.
at line 94
void
forget(string $event)
Remove a set of listeners from the dispatcher.
at line 102
void
forgetPushed()
Forget all events queued via push() in the current coroutine.
at line 110
mixed
__call(string $method, array $parameters)
Dynamically pass method calls to the underlying dispatcher.