Generic
extends Base
in package
Generic broadcaster that dispatches events inline.
Table of Contents
Properties
- $listeners : array<string|int, mixed>
Methods
- addListener() : bool
- Maps a listener class nome or object to an event name.
- broadcast() : void
- Broadcasts an event to all listeners registered to the event class.
Properties
$listeners
protected
array<string|int, mixed>
$listeners
= []
Methods
addListener()
Maps a listener class nome or object to an event name.
public
addListener(string $eventName, mixed $listener) : bool
Parameters
- $eventName : string
- $listener : mixed
-
IListener|string $listener
Return values
boolbroadcast()
Broadcasts an event to all listeners registered to the event class.
public
broadcast(IEvent $event) : void
Parameters
- $event : IEvent