callStackItem.php 1.92 KB
Newer Older
resurtm committed
1 2
<?php
/**
3 4 5 6
 * @var string|null $file
 * @var integer|null $line
 * @var string|null $class
 * @var string|null $method
resurtm committed
7 8 9 10
 * @var integer $index
 * @var string[] $lines
 * @var integer $begin
 * @var integer $end
11
 * @var \yii\web\ErrorHandler $handler
resurtm committed
12 13
 */
?>
14
<li class="<?php if (!$handler->isCoreFile($file) || $index === 1) echo 'application'; ?> call-stack-item"
15 16 17 18 19 20 21 22
    data-line="<?= (int) ($line - $begin) ?>">
    <div class="element-wrap">
        <div class="element">
            <span class="item-number"><?= (int) $index ?>.</span>
            <span class="text"><?php if ($file !== null) echo 'in ' . $handler->htmlEncode($file); ?></span>
            <?php if ($method !== null): ?>
                <span class="call">
                    <?php if ($file !== null) echo '&ndash;' ?>
23
                    <?= ($class !== null ? $handler->addTypeLinks("$class::$method") : $handler->htmlEncode($method)) . '(' . $handler->argumentsToString($args) . ')' ?>
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
                </span>
            <?php endif; ?>
            <span class="at"><?php if ($line !== null) echo 'at line'; ?></span>
            <span class="line"><?php if ($line !== null) echo (int) $line + 1; ?></span>
        </div>
    </div>
    <?php if (!empty($lines)): ?>
        <div class="code-wrap">
            <div class="error-line"></div>
            <?php for ($i = $begin; $i <= $end; ++$i): ?><div class="hover-line"></div><?php endfor; ?>
            <div class="code">
                <?php for ($i = $begin; $i <= $end; ++$i): ?><span class="lines-item"><?= (int) ($i + 1) ?></span><?php endfor; ?>
                <pre><?php
                    // fill empty lines with a whitespace to avoid rendering problems in opera
                    for ($i = $begin; $i <= $end; ++$i) {
                        echo (trim($lines[$i]) == '') ? " \n" : $handler->htmlEncode($lines[$i]);
                    }
                ?></pre>
            </div>
        </div>
    <?php endif; ?>
resurtm committed
45
</li>