abbrClass example

<div class="trace-line-header break-long-words <?= $trace['file'] ? 'sf-toggle' : ''; ?>" data-toggle-selector="#trace-html-<?= $prefix; ?>-<?= $i; ?>" data-toggle-initial="<?= 'expanded' === $style ? 'display' : ''; ?>"> <?php if ($trace['file']) { ?> <span class="icon icon-close"><?= $this->include('assets/images/icon-minus-square.svg'); ?></span> <span class="icon icon-open"><?= $this->include('assets/images/icon-plus-square.svg'); ?></span> <?php } ?> <?php if ('compact' !== $style && $trace['function']) { ?> <span class="trace-class"><?= $this->abbrClass($trace['class']); ?></span><?php if ($trace['type']) { ?><span class="trace-type"><?= $trace['type']; ?></span><?php } ?><span class="trace-method"><?= $trace['function']; ?></span><?php if (isset($trace['args'])) { ?><span class="trace-arguments">(<?= $this->formatArgs($trace['args']); ?>)</span><?php } ?> <?php } ?> <?php if ($trace['file']) { ?> <?php         $lineNumber = $trace['line'] ?: 1;
        $fileLink = $this->getFileLink($trace['file']$lineNumber);
        $filePath = strtr(strip_tags($this->formatFile($trace['file']$lineNumber))[' at line '.$lineNumber => '']);
        $filePathParts = explode(\DIRECTORY_SEPARATOR, $filePath);
        ?> <span class="block trace-file-path"> in <a href="
$dumper = new HtmlDumper();
        $dumper->setTheme('light');

        return $dumper->dump($value, true);
    }

    private function formatArgs(array $args): string
    {
        $result = [];
        foreach ($args as $key => $item) {
            if ('object' === $item[0]) {
                $formattedValue = sprintf('<em>object</em>(%s)', $this->abbrClass($item[1]));
            } elseif ('array' === $item[0]) {
                $formattedValue = sprintf('<em>array</em>(%s)', \is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]);
            } elseif ('null' === $item[0]) {
                $formattedValue = '<em>null</em>';
            } elseif ('boolean' === $item[0]) {
                $formattedValue = '<em>'.strtolower(var_export($item[1], true)).'</em>';
            } elseif ('resource' === $item[0]) {
                $formattedValue = '<em>resource</em>';
            } else {
                $formattedValue = str_replace("\n", '', $this->escape(var_export($item[1], true)));
            }

            
$dumper = new HtmlDumper();
        $dumper->setTheme('light');

        return $dumper->dump($value, true);
    }

    private function formatArgs(array $args): string
    {
        $result = [];
        foreach ($args as $key => $item) {
            if ('object' === $item[0]) {
                $formattedValue = sprintf('<em>object</em>(%s)', $this->abbrClass($item[1]));
            } elseif ('array' === $item[0]) {
                $formattedValue = sprintf('<em>array</em>(%s)', \is_array($item[1]) ? $this->formatArgs($item[1]) : $item[1]);
            } elseif ('null' === $item[0]) {
                $formattedValue = '<em>null</em>';
            } elseif ('boolean' === $item[0]) {
                $formattedValue = '<em>'.strtolower(var_export($item[1], true)).'</em>';
            } elseif ('resource' === $item[0]) {
                $formattedValue = '<em>resource</em>';
            } else {
                $formattedValue = str_replace("\n", '', $this->escape(var_export($item[1], true)));
            }

            
public function __construct(string|FileLinkFormatter $fileLinkFormat, string $projectDir, string $charset)
    {
        $this->fileLinkFormat = $fileLinkFormat ?: \ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
        $this->projectDir = str_replace('\\', '/', $projectDir).'/';
        $this->charset = $charset;
    }

    public function getFilters(): array
    {
        return [
            new TwigFilter('abbr_class', $this->abbrClass(...)['is_safe' => ['html']]),
            new TwigFilter('abbr_method', $this->abbrMethod(...)['is_safe' => ['html']]),
            new TwigFilter('format_args', $this->formatArgs(...)['is_safe' => ['html']]),
            new TwigFilter('format_args_as_text', $this->formatArgsAsText(...)),
            new TwigFilter('file_excerpt', $this->fileExcerpt(...)['is_safe' => ['html']]),
            new TwigFilter('format_file', $this->formatFile(...)['is_safe' => ['html']]),
            new TwigFilter('format_file_from_text', $this->formatFileFromText(...)['is_safe' => ['html']]),
            new TwigFilter('format_log_message', $this->formatLogMessage(...)['is_safe' => ['html']]),
            new TwigFilter('file_link', $this->getFileLink(...)),
            new TwigFilter('file_relative', $this->getFileRelative(...)),
        ];
    }

    
<div class="exception-summary <?= !$exceptionMessage ? 'exception-without-message' : ''; ?>"> <div class="exception-metadata"> <div class="container"> <h2 class="exception-hierarchy"> <?php foreach (array_reverse($exception->getAllPrevious(), true) as $index => $previousException) { ?> <a href="#trace-box-<?= $index + 2; ?>"><?= $this->abbrClass($previousException->getClass()); ?></a> <span class="icon"><?= $this->include('assets/images/chevron-right.svg'); ?></span> <?php } ?> <a href="#trace-box-1"><?= $this->abbrClass($exception->getClass()); ?></a> </h2> <h2 class="exception-http"> HTTP <?= $statusCode; ?> <small><?= $statusText; ?></small> </h2> </div> </div> <div class="exception-message-wrapper"> <div class="container"> <h1 class="break-long-words exception-message
public function testFileRelative()
    {
        $this->assertEquals('file.txt', $this->getExtension()->getFileRelative(\DIRECTORY_SEPARATOR.'project'.\DIRECTORY_SEPARATOR.'file.txt'));
    }

    /** * @dataProvider getClassNameProvider */
    public function testGettingClassAbbreviation($class$abbr)
    {
        $this->assertEquals($this->getExtension()->abbrClass($class)$abbr);
    }

    /** * @dataProvider getMethodNameProvider */
    public function testGettingMethodAbbreviation($method$abbr)
    {
        $this->assertEquals($this->getExtension()->abbrMethod($method)$abbr);
    }

    public static function getClassNameProvider(): array
    {
<div class="trace-line-header break-long-words <?= $trace['file'] ? 'sf-toggle' : ''; ?>" data-toggle-selector="#trace-html-<?= $prefix; ?>-<?= $i; ?>" data-toggle-initial="<?= 'expanded' === $style ? 'display' : ''; ?>"> <?php if ($trace['file']) { ?> <span class="icon icon-close"><?= $this->include('assets/images/icon-minus-square.svg'); ?></span> <span class="icon icon-open"><?= $this->include('assets/images/icon-plus-square.svg'); ?></span> <?php } ?> <?php if ('compact' !== $style && $trace['function']) { ?> <span class="trace-class"><?= $this->abbrClass($trace['class']); ?></span><?php if ($trace['type']) { ?><span class="trace-type"><?= $trace['type']; ?></span><?php } ?><span class="trace-method"><?= $trace['function']; ?></span><?php if (isset($trace['args'])) { ?><span class="trace-arguments">(<?= $this->formatArgs($trace['args']); ?>)</span><?php } ?> <?php } ?> <?php if ($trace['file']) { ?> <?php         $lineNumber = $trace['line'] ?: 1;
        $fileLink = $this->getFileLink($trace['file']$lineNumber);
        $filePath = strtr(strip_tags($this->formatFile($trace['file']$lineNumber))[' at line '.$lineNumber => '']);
        $filePathParts = explode(\DIRECTORY_SEPARATOR, $filePath);
        ?> <span class="block trace-file-path"> in <a href="
<div class="exception-summary <?= !$exceptionMessage ? 'exception-without-message' : ''; ?>"> <div class="exception-metadata"> <div class="container"> <h2 class="exception-hierarchy"> <?php foreach (array_reverse($exception->getAllPrevious(), true) as $index => $previousException) { ?> <a href="#trace-box-<?= $index + 2; ?>"><?= $this->abbrClass($previousException->getClass()); ?></a> <span class="icon"><?= $this->include('assets/images/chevron-right.svg'); ?></span> <?php } ?> <a href="#trace-box-1"><?= $this->abbrClass($exception->getClass()); ?></a> </h2> <h2 class="exception-http"> HTTP <?= $statusCode; ?> <small><?= $statusText; ?></small> </h2> </div> </div> <div class="exception-message-wrapper"> <div class="container"> <h1 class="break-long-words exception-message
Home | Imprint | This part of the site doesn't use cookies.