Dispatcher
class Winter\Storm\Events\Dispatcher
extends Illuminate\Events\Dispatcher
Extends
| Class | Description |
|---|---|
Illuminate\Events\Dispatcher
|
Properties
protected
$firing
:
array
= []
The event firing stack.
protected
$sorted
:
array
= []
The sorted event listeners.
Methods
public
dispatch (string | object $event, array $payload = [], boolean $halt = false)
: array | mixed
Fire an event and call the listeners.
| Property | Type | Description |
|---|---|---|
| $event | string | object |
string | object
|
| $payload | array |
array
|
| $halt | boolean |
boolean
|
public
fire (string | object $event, array $payload = [], boolean $halt = false)
: array | mixed
Fire an event and call the listeners.
| Property | Type | Description |
|---|---|---|
| $event | string | object |
string | object
|
| $payload | array |
array
|
| $halt | boolean |
boolean
|
public firing () : string
Get the event that is currently firing.
public forget ($event)
| Property | Type | Description |
|---|---|---|
| $event | mixed |
mixed
|
public getListeners (string $eventName) : array
Get all of the listeners for a given event name.
| Property | Type | Description |
|---|---|---|
| $eventName | string |
string
|
public getRawListeners () : array
Gets the raw, unprepared listeners.
public
listen (string | array | Closure | QueuedClosure $events, mixed $listener = null, integer $priority)
: void
Register an event listener with the dispatcher.
| Property | Type | Description |
|---|---|---|
| $events | string | array | Closure | QueuedClosure |
string | array | Closure | QueuedClosure
|
| $listener | mixed |
mixed
when the third parameter is omitted and a Closure or QueuedClosure is provided this parameter is used as an integer this is used as priority value |
| $priority | integer |
integer
|
public
makeListener (Closure | string | array $listener, boolean $wildcard = false)
: Closure
Register an event listener with the dispatcher.
| Property | Type | Description |
|---|---|---|
| $listener | Closure | string | array |
Closure | string | array
|
| $wildcard | boolean |
boolean
|
public
until (string | object $event, array $payload = [])
: array | null
Fire an event until the first non-null response is returned.
| Property | Type | Description |
|---|---|---|
| $event | string | object |
string | object
|
| $payload | array |
array
|
protected callQueueMethodOnHandler (string $class, string $method, array $arguments) : void
Call the queue method on the handler class.
| Property | Type | Description |
|---|---|---|
| $class | string |
string
|
| $method | string |
string
|
| $arguments | array |
array
|
protected cloneArgumentsForQueueing (array $arguments) : array
Clone the given arguments for queueing.
| Property | Type | Description |
|---|---|---|
| $arguments | array |
array
|
protected createClassCallable (array | string $listener) : callable
Create the class based event callable.
| Property | Type | Description |
|---|---|---|
| $listener | array | string |
array | string
|
protected createQueuedHandlerCallable (string $class, string $method) : Closure
Create a callable for putting an event handler on the queue.
| Property | Type | Description |
|---|---|---|
| $class | string |
string
|
| $method | string |
string
|
protected sortListeners (string $eventName) : void
Sort the listeners for a given event by priority.
| Property | Type | Description |
|---|---|---|
| $eventName | string |
string
|