Passed
Push — master ( 9a27aa...bae487 )
by Alexander
27:21 queued 24:19
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
13
$html = <<<HTML
14 1
IDE
15
<svg class="icon icon--new-window" focusable="false" aria-hidden="true" width="16" height="16">
16
    <use href="#new-window"></use>
17
</svg>
18
HTML;
19
?>
20 1
<li class="<?= ($index === 1 || !$this->isCoreFile($file)) ? 'application' : '' ?> call-stack-item"
21 1
    data-line="<?= (int) ($line - $begin) ?>">
22
    <div class="element-wrap">
23
        <div class="element">
24 1
            <span class="item-number"><?= (int) $index ?>.</span>
25 1
            <span class="text"><?= $file !== null ? 'in ' . $this->htmlEncode($file) : '' ?></span>
26 1
            <?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...
27
                <span> &ndash; </span>
28
                <?= strtr($this->traceLine, ['{file}' => $file, '{line}' => $line + 1, '{html}' => $html]) ?>
29
            <?php endif; ?>
30 1
            <span class="at">
31 1
                <?= $line !== null ? 'at line' : '' ?>
32 1
                <span class="line"><?= $line !== null ? $line + 1 : '' ?></span>
33
            </span>
34 1
            <?php if ($method !== null): ?>
35 1
                <span class="call">
36 1
                    <?= $file !== null ? '&ndash;' : '' ?>
37 1
                    <?= ($class !== null ? $this->addTypeLinks("$class::$method") : $this->htmlEncode($method)) . '(' . $this->argumentsToString($args) . ')' ?>
38 1
                </span>
39
            <?php endif; ?>
40 1
        </div>
41
    </div>
42 1
    <?php if (!empty($lines)): ?>
43 1
        <div class="code-wrap">
44
            <div class="error-line"></div>
45 1
            <?php for ($i = $begin; $i <= $end; ++$i): ?><div class="hover-line"></div><?php endfor; ?>
46 1
            <div class="code">
47 1
                <?php for ($i = $begin; $i <= $end; ++$i): ?><span class="lines-item"><?= (int) ($i + 1) ?></span><?php endfor; ?>
48 1
                <pre><?php
49
                    // fill empty lines with a whitespace to avoid rendering problems in opera
50 1
                    for ($i = $begin; $i <= $end; ++$i) {
51 1
                        echo (trim($lines[$i]) === '') ? " \n" : $this->htmlEncode($lines[$i]);
52
                    }
53 1
                    ?></pre>
54
            </div>
55
        </div>
56
    <?php endif; ?>
57
</li>
58