yii\web\ErrorHandler::renderCallStackItem PHP Метод

renderCallStackItem() публичный Метод

Renders a single call stack element.
public renderCallStackItem ( string | null $file, integer | null $line, string | null $class, string | null $method, array $args, integer $index ) : string
$file string | null name where call has happened.
$line integer | null number on which call has happened.
$class string | null called class name.
$method string | null called function/method name.
$args array array of method arguments.
$index integer number of the call stack element.
Результат string HTML content of the rendered call stack element.
    public function renderCallStackItem($file, $line, $class, $method, $args, $index)
    {
        $lines = [];
        $begin = $end = 0;
        if ($file !== null && $line !== null) {
            $line--;
            // adjust line number from one-based to zero-based
            $lines = @file($file);
            if ($line < 0 || $lines === false || ($lineCount = count($lines)) < $line) {
                return '';
            }
            $half = (int) (($index === 1 ? $this->maxSourceLines : $this->maxTraceSourceLines) / 2);
            $begin = $line - $half > 0 ? $line - $half : 0;
            $end = $line + $half < $lineCount ? $line + $half : $lineCount - 1;
        }
        return $this->renderFile($this->callStackItemView, ['file' => $file, 'line' => $line, 'class' => $class, 'method' => $method, 'index' => $index, 'lines' => $lines, 'begin' => $begin, 'end' => $end, 'args' => $args]);
    }