Skip to content

Commit

Permalink
Fix stack trace nav.
Browse files Browse the repository at this point in the history
Include file/line less frames and use the correct method call type.
  • Loading branch information
markstory committed Dec 5, 2014
1 parent fd77400 commit 77624ea
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/Template/Element/exception_stack_trace_nav.ctp
Expand Up @@ -20,15 +20,19 @@ use Cake\Error\Debugger;
<?php foreach ($error->getTrace() as $i => $stack): ?>
<?php $class = (isset($stack['file']) && strpos(APP, $stack['file']) === false) ? 'vendor-frame' : 'app-frame'; ?>
<li class="stack-frame <?= $class ?>">
<?php if (isset($stack['file']) && isset($stack['line'])): ?>
<?php if (isset($stack['function'])): ?>
<a href="#" data-target="stack-frame-<?= $i ?>">
<?php if (!isset($stack['class'])): ?>
<span class="stack-function">&rang; <?= h($stack['function']) ?></span>
<?php if (isset($stack['class'])): ?>
<span class="stack-function">&rang; <?= h($stack['class'] . $stack['type'] . $stack['function']) ?></span>
<?php else: ?>
<span class="stack-function">&rang; <?= h($stack['class']) ?>::<?= h($stack['function']) ?></span>
<span class="stack-function">&rang; <?= h($stack['function']) ?></span>
<?php endif; ?>
<span class="stack-file">
<?php if (isset($stack['file'], $stack['line'])): ?>
<?= h(Debugger::trimPath($stack['file'])) ?>, line <?= $stack['line'] ?>
<?php else: ?>
[internal function]
<?php endif ?>
</span>
</a>
<?php else: ?>
Expand Down

0 comments on commit 77624ea

Please sign in to comment.