PHP Class Event, someline-starter

Show file Open project: someline/someline-starter Class Usage Examples

Public Methods

Method Description
createClassListener ( mixed $listener ) : Closure Create a class based listener using the IoC container.
fire ( string | object $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 pushed listeners.
getListeners ( string $eventName ) : array Get all of the listeners for a given event name.
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.
makeListener ( mixed $listener ) : mixed Register an event listener with the dispatcher.
push ( string $event, array $payload = [] ) : void Register an event and payload to be fired later.
setQueueResolver ( callable $resolver ) Set the queue resolver implementation.
subscribe ( object | string $subscriber ) : void Register an event subscriber with the dispatcher.
until ( string | object $event, array $payload = [] ) : mixed Fire an event until the first non-null response is returned.

Method Details

createClassListener() public static method

Create a class based listener using the IoC container.
public static createClassListener ( mixed $listener ) : Closure
$listener mixed
return Closure

fire() public static method

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

firing() public static method

Get the event that is currently firing.
public static firing ( ) : string
return string

flush() public static method

Flush a set of pushed events.
public static flush ( string $event ) : void
$event string
return void

forget() public static method

Remove a set of listeners from the dispatcher.
public static forget ( string $event ) : void
$event string
return void

forgetPushed() public static method

Forget all of the pushed listeners.
public static forgetPushed ( ) : void
return void

getListeners() public static method

Get all of the listeners for a given event name.
public static getListeners ( string $eventName ) : array
$eventName string
return array

hasListeners() public static method

Determine if a given event has listeners.
public static hasListeners ( string $eventName ) : boolean
$eventName string
return boolean

listen() public static method

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

makeListener() public static method

Register an event listener with the dispatcher.
public static makeListener ( mixed $listener ) : mixed
$listener mixed
return mixed

push() public static method

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

setQueueResolver() public static method

Set the queue resolver implementation.
public static setQueueResolver ( callable $resolver )
$resolver callable

subscribe() public static method

Register an event subscriber with the dispatcher.
public static subscribe ( object | string $subscriber ) : void
$subscriber object | string
return void

until() public static method

Fire an event until the first non-null response is returned.
public static until ( string | object $event, array $payload = [] ) : mixed
$event string | object
$payload array
return mixed