Documentation

TraceableEventDispatcher extends TraceableEventDispatcher
in package

Collects some data about event listeners.

This event dispatcher delegates the dispatching to another one.

Tags
author

Fabien Potencier fabien@symfony.com

Table of Contents

$logger  : mixed
$stopwatch  : mixed
$callStack  : SplObjectStorage<WrappedListener, array{: string, : string}>
$currentRequestHash  : mixed
$dispatcher  : mixed
$orphanedEvents  : mixed
$requestStack  : mixed
$wrappedListeners  : mixed
__call()  : mixed
Proxies all method calls to the original event dispatcher.
__construct()  : mixed
addListener()  : mixed
Adds an event listener that listens on the specified events.
addSubscriber()  : mixed
Adds an event subscriber.
dispatch()  : object
{@inheritdoc}
getCalledListeners()  : array<string|int, mixed>
getListenerPriority()  : int|null
Gets the listener priority for a specific event.
getListeners()  : array<string|int, callable[]|callable>
Gets the listeners of a specific event or all listeners sorted by descending priority.
getNotCalledListeners()  : array<string|int, mixed>
getOrphanedEvents()  : array<string|int, mixed>
hasListeners()  : bool
Checks whether an event has any registered listeners.
removeListener()  : mixed
Removes an event listener from the specified events.
removeSubscriber()  : mixed
reset()  : mixed
afterDispatch()  : mixed
Called after dispatching the event.
beforeDispatch()  : mixed
Called before dispatching the event.
postProcess()  : void
preProcess()  : void
sortNotCalledListeners()  : mixed

Properties

Methods

__call()

Proxies all method calls to the original event dispatcher.

public __call(string $method, array<string|int, mixed> $arguments) : mixed
Parameters
$method : string

The method name

$arguments : array<string|int, mixed>

The method arguments

Return values
mixed

addListener()

Adds an event listener that listens on the specified events.

public addListener(string $eventName, mixed $listener, int $priority) : mixed
Parameters
$eventName : string
$listener : mixed
$priority : int

The higher this value, the earlier an event listener will be triggered in the chain (defaults to 0)

Return values
mixed

dispatch()

{@inheritdoc}

public dispatch(object $event[, string|null $eventName = null ]) : object
Parameters
$event : object
$eventName : string|null = null
Return values
object

getCalledListeners()

public getCalledListeners([Request|null $request = null ]) : array<string|int, mixed>
Parameters
$request : Request|null = null
Return values
array<string|int, mixed>

getListenerPriority()

Gets the listener priority for a specific event.

public getListenerPriority(string $eventName, mixed $listener) : int|null
Parameters
$eventName : string
$listener : mixed
Return values
int|null

getListeners()

Gets the listeners of a specific event or all listeners sorted by descending priority.

public getListeners([string|null $eventName = null ]) : array<string|int, callable[]|callable>
Parameters
$eventName : string|null = null
Return values
array<string|int, callable[]|callable>

getNotCalledListeners()

public getNotCalledListeners([Request|null $request = null ]) : array<string|int, mixed>
Parameters
$request : Request|null = null
Return values
array<string|int, mixed>

getOrphanedEvents()

public getOrphanedEvents([Request|null $request = null ]) : array<string|int, mixed>
Parameters
$request : Request|null = null
Return values
array<string|int, mixed>

hasListeners()

Checks whether an event has any registered listeners.

public hasListeners([string|null $eventName = null ]) : bool
Parameters
$eventName : string|null = null
Return values
bool

removeListener()

Removes an event listener from the specified events.

public removeListener(string $eventName, mixed $listener) : mixed
Parameters
$eventName : string
$listener : mixed
Return values
mixed

afterDispatch()

Called after dispatching the event.

protected afterDispatch(string $eventName, object $event) : mixed
Parameters
$eventName : string
$event : object
Return values
mixed

beforeDispatch()

Called before dispatching the event.

protected beforeDispatch(string $eventName, object $event) : mixed
Parameters
$eventName : string
$event : object
Return values
mixed

postProcess()

private postProcess(string $eventName) : void
Parameters
$eventName : string
Return values
void

preProcess()

private preProcess(string $eventName) : void
Parameters
$eventName : string
Return values
void

sortNotCalledListeners()

private sortNotCalledListeners(array<string|int, mixed> $a, array<string|int, mixed> $b) : mixed
Parameters
$a : array<string|int, mixed>
$b : array<string|int, mixed>
Return values
mixed

Search results