Completed
Push — master ( 87f821...fcdf89 )
by Alexander
03:21
created

src/ErrorHandler/templates/callStackItem.php (1 issue)

Labels
Severity
1
<?php
2
/* @var $file string|null */
3
/* @var $line int|null */
4
/* @var $class string|null */
5
/* @var $method string|null */
6
/* @var $index int */
7
/* @var $lines string[] */
8
/* @var $begin int */
9
/* @var $end int */
10
/* @var $args array */
11
/* @var $this \Yiisoft\Yii\Web\ErrorHandler\HtmlRenderer */
12
$html = <<<HTML
13
IDE
14
<svg class="icon icon--new-window" focusable="false" aria-hidden="true" width="16" height="16">
15
    <use href="#new-window"></use>
16
</svg>
17
HTML;
18
?>
19
<li class="<?= ($index === 1 || !$this->isCoreFile($file)) ? 'application' : '' ?> call-stack-item"
20
    data-line="<?= (int) ($line - $begin) ?>">
21
    <div class="element-wrap">
22
        <div class="element">
23
            <span class="item-number"><?= (int) $index ?>.</span>
24
            <span class="text"><?= $file !== null ? 'in ' . $this->htmlEncode($file) : '' ?></span>
25
            <?php if ($this->traceLine !== '{html}'): ?>
0 ignored issues
show
The property traceLine is declared private in Yiisoft\Yii\Web\ErrorHandler\HtmlRenderer and cannot be accessed from this context.
Loading history...
26
                <span> &ndash; </span>
27
                <?= strtr($this->traceLine, ['{file}' => $file, '{line}' => $line + 1, '{html}' => $html]) ?>
28
            <?php endif; ?>
29
            <span class="at">
30
                <?= $line !== null ? 'at line' : '' ?>
31
                <span class="line"><?= $line !== null ? $line + 1 : '' ?></span>
32
            </span>
33
            <?php if ($method !== null): ?>
34
                <span class="call">
35
                    <?= $file !== null ? '&ndash;' : '' ?>
36
                    <?= ($class !== null ? $this->addTypeLinks("$class::$method") : $this->htmlEncode($method)) . '(' . $this->argumentsToString($args) . ')' ?>
37
                </span>
38
            <?php endif; ?>
39
        </div>
40
    </div>
41
    <?php if (!empty($lines)): ?>
42
        <div class="code-wrap">
43
            <div class="error-line"></div>
44
            <?php for ($i = $begin; $i <= $end; ++$i): ?><div class="hover-line"></div><?php endfor; ?>
45
            <div class="code">
46
                <?php for ($i = $begin; $i <= $end; ++$i): ?><span class="lines-item"><?= (int) ($i + 1) ?></span><?php endfor; ?>
47
                <pre><?php
48
                    // fill empty lines with a whitespace to avoid rendering problems in opera
49
                    for ($i = $begin; $i <= $end; ++$i) {
50
                        echo (trim($lines[$i]) === '') ? " \n" : $this->htmlEncode($lines[$i]);
51
                    }
52
                    ?></pre>
53
            </div>
54
        </div>
55
    <?php endif; ?>
56
</li>
57