PHP Class TestDispatcher

Inheritance: extends Dispatcher
Afficher le fichier Open project: tzookb/tbmsg Class Usage Examples

Méthodes publiques

Méthode Description
fire ( string $event, mixed $payload = [], boolean $halt = false ) : array | null Fire an event and call the listeners.
firing ( ) : string Get the event that is currently firing.
flush ( string $event ) : void Flush a set of pushed events.
forget ( string $event ) : void Remove a set of listeners from the dispatcher.
forgetPushed ( ) : void Forget all of the queued listeners.
hasListeners ( string $eventName ) : boolean Determine if a given event has listeners.
listen ( string | array $events, mixed $listener, integer $priority ) : void Register an event listener with the dispatcher.
push ( string $event, array $payload = [] ) : void Register an event and payload to be fired later.
subscribe ( object | string $subscriber ) : void Register an event subscriber with the dispatcher.
until ( string $event, array $payload = [] ) : mixed Fire an event until the first non-null response is returned.

Method Details

fire() public méthode

Fire an event and call the listeners.
public fire ( string $event, mixed $payload = [], boolean $halt = false ) : array | null
$event string
$payload mixed
$halt boolean
Résultat array | null

firing() public méthode

Get the event that is currently firing.
public firing ( ) : string
Résultat string

flush() public méthode

Flush a set of pushed events.
public flush ( string $event ) : void
$event string
Résultat void

forget() public méthode

Remove a set of listeners from the dispatcher.
public forget ( string $event ) : void
$event string
Résultat void

forgetPushed() public méthode

Forget all of the queued listeners.
public forgetPushed ( ) : void
Résultat void

hasListeners() public méthode

Determine if a given event has listeners.
public hasListeners ( string $eventName ) : boolean
$eventName string
Résultat boolean

listen() public méthode

Register an event listener with the dispatcher.
public listen ( string | array $events, mixed $listener, integer $priority ) : void
$events string | array
$listener mixed
$priority integer
Résultat void

push() public méthode

Register an event and payload to be fired later.
public push ( string $event, array $payload = [] ) : void
$event string
$payload array
Résultat void

subscribe() public méthode

Register an event subscriber with the dispatcher.
public subscribe ( object | string $subscriber ) : void
$subscriber object | string
Résultat void

until() public méthode

Fire an event until the first non-null response is returned.
public until ( string $event, array $payload = [] ) : mixed
$event string
$payload array
Résultat mixed