"Fossies" - the Fresh Open Source Software Archive

Member "phpMyAdmin-5.1.0-all-languages/libraries/classes/Twig/I18nExtension.php" (24 Feb 2021, 745 Bytes) of package /linux/www/phpMyAdmin-5.1.0-all-languages.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "I18nExtension.php": 5.0.4-english_vs_5.1.0-english.

    1 <?php
    2 
    3 declare(strict_types=1);
    4 
    5 namespace PhpMyAdmin\Twig;
    6 
    7 use PhpMyAdmin\Twig\Extensions\I18nExtension as TwigI18nExtension;
    8 use PhpMyAdmin\Twig\I18n\TokenParserTrans;
    9 use Twig\TokenParser\TokenParserInterface;
   10 use Twig\TwigFilter;
   11 
   12 class I18nExtension extends TwigI18nExtension
   13 {
   14     /**
   15      * Returns the token parser instances to add to the existing list.
   16      *
   17      * @return TokenParserInterface[]
   18      */
   19     public function getTokenParsers()
   20     {
   21         return [new TokenParserTrans()];
   22     }
   23 
   24     /**
   25      * Returns a list of filters to add to the existing list.
   26      *
   27      * @return TwigFilter[]
   28      */
   29     public function getFilters()
   30     {
   31         return [
   32             new TwigFilter('trans', '_gettext'),
   33         ];
   34     }
   35 }