for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Yiisoft\VarDumper\Debug;
use Yiisoft\VarDumper\HandlerInterface;
final class DebugHandlerInterfaceProxy implements HandlerInterface
{
public function __construct(
private HandlerInterface $decorated,
private VarDumperCollector $collector,
) {
}
public function handle(mixed $variable, int $depth, bool $highlight = false): void
$stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
$callStack = null;
foreach ($stack as $value) {
if (!isset($value['file'])) {
continue;
if (str_ends_with($value['file'], '/var-dumper/src/functions.php')) {
if (str_ends_with($value['file'], '/var-dumper/src/VarDumper.php')) {
$callStack = $value;
break;
$this->collector->collectVar(
$variable,
$callStack === null ? '' : $callStack['file'] . ':' . $callStack['line']
);
$this->decorated->handle($variable, $depth, $highlight);