Skip to content
PHP Ecosystem
Explore

DebugEventDispatcher

API reference › Yii3 Debug › Event › DebugEventDispatcher

final readonly classYii3\Debug\Event\DebugEventDispatcher
ImplementsPsr\EventDispatcher\EventDispatcherInterface
Sourcesrc/Event/DebugEventDispatcher.php

Records PSR-14 event and immediate caller metadata before delegating to the application dispatcher.

MethodDescriptionDefined by
__construct()Creates an event-dispatcher proxy that records each event before delegation.DebugEventDispatcher
dispatch()Records the event and its immediate caller, then delegates to the application dispatcher.DebugEventDispatcher
public function __construct(Psr\EventDispatcher\EventDispatcherInterface $dispatcher, Yii3\Debug\Collector\EventCollector $collector, PHPForge\Debug\Instrumentation\InstrumentationGuard|null $guard = null)

Creates an event-dispatcher proxy that records each event before delegation.

Parameters

ParameterTypeDescription
$dispatcherPsr\EventDispatcher\EventDispatcherInterfaceApplication dispatcher every event is delegated to.
$collectorYii3\Debug\Collector\EventCollectorCollector recording the event and its immediate caller.
$guardPHPForge\Debug\Instrumentation\InstrumentationGuard|nullGuard isolating capture failures, or null to build the default.
public function dispatch(object $event): object

Records the event and its immediate caller, then delegates to the application dispatcher.

Parameters

ParameterTypeDescription
$eventobjectEvent being dispatched.

Returns

object: Event as returned by the application dispatcher.