DumpHandlerProxy
API reference › Yii3 Debug › Dump › DumpHandlerProxy
Intercepts yiisoft/var-dumper dumps to feed the DumpCollector, then forwards each dump unchanged.
DumpCollector::startup() installs the proxy as the var-dumper default handler, so VarDumper::dump() and the
yiisoft/var-dumper helpers d(), dump(), and dd() pass through it while the application output stays exactly
what the decorated handler produces. When symfony/var-dumper is loaded first, as Codeception and PsySH do, its own
global dump() and dd() are defined instead and never reach this proxy.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Creates a dump-handler proxy that records and then forwards each dump. | DumpHandlerProxy |
handle() | Records the dump with its call site, then forwards it to the decorated handler. | DumpHandlerProxy |
handler() | Returns the handler the proxy decorates. | DumpHandlerProxy |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(Yiisoft\VarDumper\HandlerInterface $handler, Yii3\Debug\Collector\DumpCollector $collector)Creates a dump-handler proxy that records and then forwards each dump.
Parameters
| Parameter | Type | Description |
|---|---|---|
$handler | Yiisoft\ | Handler that was the default before the proxy, receiving every dump. |
$collector | Yii3\ | Collector recording the dumps of the request. |
handle()
Section titled “handle() ”public function handle(mixed $variable, int $depth, bool $highlight = false): voidRecords the dump with its call site, then forwards it to the decorated handler.
Recording comes first, so the dump is already in the collector when the decorated handler throws, or when dd()
ends the script right after the output and DeferredCapture writes the capture
armed for the request at shutdown.
Parameters
| Parameter | Type | Description |
|---|---|---|
$variable | mixed | Dumped value. |
$depth | int | Maximum nesting depth requested by the caller. |
$highlight | bool | Whether the caller requested syntax-highlighted output. |
handler()
Section titled “handler() ”public function handler(): Yiisoft\VarDumper\HandlerInterfaceReturns the handler the proxy decorates.
Returns
Yiisoft\VarDumper\HandlerInterface: Handler receiving every forwarded dump.