Skip to content
PHP Ecosystem
Explore

EventCollector

API reference › Debug › collectors › EventCollector

classyii\debug\collectors\EventCollector
ExtendsCollector
ImplementsCollectorInterface
Sourcesrc/collectors/EventCollector.php

Captures framework events reaching the global listener during the request for the Events panel.

PropertyTypeDescriptionDefined by
$captureContextboolOpt-in capture of selected action/view metadata; event values and rendered output are never dumped. Default: false.EventCollector
$moduleyii\debug\Module|nullDebug module supplying the log target and sibling collectors, assigned by the module on registration. Default: null.Collector
$traceLimitintOpt-in argument-free trace depth; zero disables capture, and sixteen is the hard maximum. Default: 0.EventCollector
MethodDescriptionDefined by
capture() finalEncodes the typed snapshot built by the subclass into the payload persisted for the panel.Collector
id()Returns the stable ID pairing this collector with the Events panel.EventCollector
instrument()Installs low-level instrumentation as soon as the module registers the collector, before the panels are built.Collector
shutdown() finalDeactivates the collector once, releasing any subscription created by start().Collector
startup() finalActivates the collector once at the start of the request lifecycle.Collector
getLogMessages() protectedReturns the accumulated log messages, optionally filtered by level, category, and exclusion lists.Collector
getLogTarget() protectedReturns the initialized log target of the owning debug module.Collector
isStarted() protectedReturns whether the collector is active for the current request.Collector
snapshot() protectedReturns the captured events as a typed snapshot.EventCollector
start() protectedRegisters the wildcard event listener that records every fired event into $events.EventCollector
stop() protectedDetaches the wildcard listener and clears the accumulated events, so a reused worker process starts clean.EventCollector
public function id(): string

Returns the stable ID pairing this collector with the Events panel.

Returns

string: Stable collector ID.

protected function snapshot(): PHPForge\Debug\Panel\Event\EventSnapshot|null

Returns the captured events as a typed snapshot.

Returns

PHPForge\Debug\Panel\Event\EventSnapshot|null: Captured event payload; null when the collector never started.

protected function start(): void

Registers the wildcard event listener that records every fired event into $events.

protected function stop(): void

Detaches the wildcard listener and clears the accumulated events, so a reused worker process starts clean.