EventEmitterErrorTrait
trait EventEmitterErrorTrait
Our Event Emitter Error Trait. This one throws an exception if there is not an error event listener when an error event gets emitted.
Traits
Properties
| protected array | $listeners | from EventEmitterTrait | |
| protected array | $onceListeners | from EventEmitterTrait |
Methods
Attach a listener to an event, for exactly once.
Remove specified listener from an event.
Remove all listeners from an event (or all listeners).
Get listeners for a specific events, or all listeners.
Emits an event, catching all exceptions and emitting an error event for these exceptions.
Details
in EventEmitterTrait at line 34
$this
on(string $event, callable $listener)
Attach a listener to an event.
in EventEmitterTrait at line 50
$this
once(string $event, callable $listener)
Attach a listener to an event, for exactly once.
in EventEmitterTrait at line 66
$this
removeListener(string $event, callable $listener)
Remove specified listener from an event.
in EventEmitterTrait at line 95
$this
removeAllListeners(string|null $event = null)
Remove all listeners from an event (or all listeners).
in EventEmitterTrait at line 116
array
listeners(string|null $event = null)
Get listeners for a specific events, or all listeners.
at line 25
void
emit(string $event, mixed ...$arguments)
Emits an event, catching all exceptions and emitting an error event for these exceptions.