Skip to content

Commit

Permalink
Correctly detect file from ddd (#216)
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Jul 13, 2020
2 parents b83009c + 0abcee5 commit ed5ec68
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/DumpRecorder/DumpRecorder.php
Expand Up @@ -47,10 +47,15 @@ public function register(): self

public function record(Data $data)
{
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 7);
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 8);
$file = Arr::get($backtrace, '6.file');
$lineNumber = Arr::get($backtrace, '6.line');

if (! Arr::exists($backtrace, '7.class') && Arr::get($backtrace, '7.function') === 'ddd') {
$file = Arr::get($backtrace, '7.file');
$lineNumber = Arr::get($backtrace, '7.line');
}

$htmlDump = (new HtmlDumper())->dump($data);

$this->dumps[] = new Dump($htmlDump, $file, $lineNumber);
Expand Down

0 comments on commit ed5ec68

Please sign in to comment.