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.

Parameters

string $event
callable $listener

Return Value

$this

at line 30
$this once(string $event, callable $listener)

Attach a listener to an event, for exactly once.

Parameters

string $event
callable $listener

Return Value

$this

at line 38
$this removeListener(string $event, callable $listener)

Remove specified listener from an event.

Parameters

string $event
callable $listener

Return Value

$this

at line 45
$this removeAllListeners(string|null $event = null)

Remove all listeners from an event (or all listeners).

Parameters

string|null $event

Return Value

$this

at line 52
array listeners(string|null $event = null)

Get listeners for a specific events, or all listeners.

Parameters

string|null $event

Return Value

array

at line 60
void emit(string $event, mixed ...$arguments)

Emits an event, catching all exceptions and emitting an error event for these exceptions.

Parameters

string $event
mixed ...$arguments

Return Value

void