Skip to content
PHP Ecosystem
Explore

DumpCollector

API reference › Debug › collectors › DumpCollector

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

Captures trace-level log messages emitted by Yii::debug() for the Dump panel.

PropertyTypeDescriptionDefined by
$categorieslist<string>Message categories to capture; an empty list captures every category. Default: ['application'].DumpCollector
$depthintMaximum recursion depth applied by the dumper. Default: 10.DumpCollector
$highlightboolWhether the rendered dump should be syntax-highlighted. Default: true.DumpCollector
$moduleyii\debug\Module|nullDebug module supplying the log target and sibling collectors, assigned by the module on registration. Default: null.Collector
$varDumpCallbackClosure(mixed, self): string|nullCallback that replaces the built-in VarDumper rendering when set. Default: null.DumpCollector
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 Dump panel.DumpCollector
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
varDump()Renders a captured value as a display string.DumpCollector
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() protectedCaptures the trace-level messages allowed by $categories, excluding the categories owned by the Router collector, and pre-renders each captured value through varDump().DumpCollector
start() protectedHook invoked once when the collector activates; subclasses subscribe to framework events here.Collector
stop() protectedHook invoked once when the collector deactivates; subclasses detach subscriptions and clear state here.Collector
public function id(): string

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

Returns

string: Stable collector ID.

public function varDump(mixed $var): string

Renders a captured value as a display string.

The built-in highlighter emits safe markup, so highlighted output is passed through unchanged. Plain output and custom callback output are HTML-escaped explicitly.

Parameters

ParameterTypeDescription
$varmixedValue passed to Yii::debug().

Returns

string: Display string safe to embed in the dump card.

protected function snapshot(): PHPForge\Debug\Panel\Dump\DumpSnapshot|null

Captures the trace-level messages allowed by $categories, excluding the categories owned by the Router collector, and pre-renders each captured value through varDump().

Returns

PHPForge\Debug\Panel\Dump\DumpSnapshot|null: Captured dump payload; null when the collector never started.