abbrMethod example


    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
    {
        return [
            ['F\Q\N\Foo', '<abbr title="F\Q\N\Foo">Foo</abbr>'],
            ['Bare', '<abbr title="Bare">Bare</abbr>'],
        ];
    }

    public static function getMethodNameProvider(): array
    {
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(...)),
        ];
    }

    
Home | Imprint | This part of the site doesn't use cookies.