DebugEventDispatcher
API reference › Yii3 Debug › Event › DebugEventDispatcher
Records PSR-14 event and immediate caller metadata before delegating to the application dispatcher.
Methods
Section titled “Methods”| Method | Description | Defined 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 |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”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
| Parameter | Type | Description |
|---|---|---|
$dispatcher | Psr\ | Application dispatcher every event is delegated to. |
$collector | Yii3\ | Collector recording the event and its immediate caller. |
$guard | PHPForge\ | Guard isolating capture failures, or null to build the default. |
dispatch()
Section titled “dispatch() ”public function dispatch(object $event): objectRecords the event and its immediate caller, then delegates to the application dispatcher.
Parameters
| Parameter | Type | Description |
|---|---|---|
$event | object | Event being dispatched. |
Returns
object: Event as returned by the application dispatcher.