EventEmitterInterface
interface EventEmitterInterface
The event emitter interface.
Methods
$this
on(string $event, callable $listener)
Attach a listener to an event.
$this
once(string $event, callable $listener)
Attach a listener to an event, for exactly once.
$this
removeListener(string $event, callable $listener)
Remove specified listener from an event.
$this
removeAllListeners(string|null $event = null)
Remove all listeners from an event (or all listeners).
array
listeners(string|null $event = null)
Get listeners for a specific events, or all listeners.
void
emit(string $event, mixed ...$arguments)
Emits an event, catching all exceptions and emitting an error event for these exceptions.
Details
at line 22
$this
on(string $event, callable $listener)
Attach a listener to an event.
at line 30
$this
once(string $event, callable $listener)
Attach a listener to an event, for exactly once.
at line 38
$this
removeListener(string $event, callable $listener)
Remove specified listener from an event.
at line 45
$this
removeAllListeners(string|null $event = null)
Remove all listeners from an event (or all listeners).
at line 52
array
listeners(string|null $event = null)
Get listeners for a specific events, or all listeners.
at line 60
void
emit(string $event, mixed ...$arguments)
Emits an event, catching all exceptions and emitting an error event for these exceptions.