DumpCollector
API reference › Debug › collectors › DumpCollector
Captures trace-level log messages emitted by Yii::debug() for the Dump panel.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$categories | list<string> | Message categories to capture; an empty list captures every category. Default: ['application']. | DumpCollector |
$depth | int | Maximum recursion depth applied by the dumper. Default: 10. | DumpCollector |
$highlight | bool | Whether the rendered dump should be syntax-highlighted. Default: true. | DumpCollector |
$module | yii\| | Debug module supplying the log target and sibling collectors, assigned by the module on registration. Default: null. | Collector |
$varDumpCallback | Closure(mixed, | Callback that replaces the built-in VarDumper rendering when set. Default: null. | DumpCollector |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
capture() final | Encodes 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() final | Deactivates the collector once, releasing any subscription created by start(). | Collector |
startup() final | Activates the collector once at the start of the request lifecycle. | Collector |
varDump() | Renders a captured value as a display string. | DumpCollector |
getLogMessages() protected | Returns the accumulated log messages, optionally filtered by level, category, and exclusion lists. | Collector |
getLogTarget() protected | Returns the initialized log target of the owning debug module. | Collector |
isStarted() protected | Returns whether the collector is active for the current request. | Collector |
snapshot() protected | Captures 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() protected | Hook invoked once when the collector activates; subclasses subscribe to framework events here. | Collector |
stop() protected | Hook invoked once when the collector deactivates; subclasses detach subscriptions and clear state here. | Collector |
Method details
Section titled “Method details”public function id(): stringReturns the stable ID pairing this collector with the Dump panel.
Returns
string: Stable collector ID.
varDump()
Section titled “varDump() ”public function varDump(mixed $var): stringRenders 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
| Parameter | Type | Description |
|---|---|---|
$var | mixed | Value passed to Yii::debug(). |
Returns
string: Display string safe to embed in the dump card.
snapshot()
Section titled “snapshot() ”protected function snapshot(): PHPForge\Debug\Panel\Dump\DumpSnapshot|nullCaptures 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.