formatArgsAsText example

$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(...)),
        ];
    }

    public function abbrClass(string $class): string
    {
        
<?php if ($exception['trace']) { ?> <pre class="stacktrace"> <?php                     echo $this->escape($exception['class']).":\n";
                    if ($exception['message']) {
                        echo $this->escape($exception['message'])."\n";
                    }

                    foreach ($exception['trace'] as $trace) {
                        echo "\n ";
                        if ($trace['function']) {
                            echo $this->escape('at '.$trace['class'].$trace['type'].$trace['function']).'('.(isset($trace['args']) ? $this->formatArgsAsText($trace['args']) : '').')';
                        }
                        if ($trace['file'] && $trace['line']) {
                            echo($trace['function'] ? "\n (" : 'at ').strtr(strip_tags($this->formatFile($trace['file']$trace['line']))[' at line '.$trace['line'] => '']).':'.$trace['line'].($trace['function'] ? ')' : '');
                        }
                    }
?> </pre> <?php } ?> </td> </tr> </tbody> </table>
<?php if ($exception['trace']) { ?> <pre class="stacktrace"> <?php                     echo $this->escape($exception['class']).":\n";
                    if ($exception['message']) {
                        echo $this->escape($exception['message'])."\n";
                    }

                    foreach ($exception['trace'] as $trace) {
                        echo "\n ";
                        if ($trace['function']) {
                            echo $this->escape('at '.$trace['class'].$trace['type'].$trace['function']).'('.(isset($trace['args']) ? $this->formatArgsAsText($trace['args']) : '').')';
                        }
                        if ($trace['file'] && $trace['line']) {
                            echo($trace['function'] ? "\n (" : 'at ').strtr(strip_tags($this->formatFile($trace['file']$trace['line']))[' at line '.$trace['line'] => '']).':'.$trace['line'].($trace['function'] ? ')' : '');
                        }
                    }
?> </pre> <?php } ?> </td> </tr> </tbody> </table>
Home | Imprint | This part of the site doesn't use cookies.