File "MessageExtension.php"

Full Path: /home/vantageo/public_html/cache/cache/cache/.wp-cli/wp-content/plugins/wp-phpmyadmin-extension/lib/phpMyAdmin/libraries/classes/Twig/MessageExtension.php
File size: 1.1 KB
MIME-type: text/x-php
Charset: utf-8

<?php

declare(strict_types=1);

namespace PhpMyAdmin\Twig;

use PhpMyAdmin\Message;
use Twig\Extension\AbstractExtension;
use Twig\TwigFilter;

class MessageExtension extends AbstractExtension
{
    /**
     * Returns a list of filters to add to the existing list.
     *
     * @return TwigFilter[]
     */
    public function getFilters()
    {
        return [
            new TwigFilter(
                'notice',
                static function (string $string) {
                    return Message::notice($string)->getDisplay();
                },
                ['is_safe' => ['html']]
            ),
            new TwigFilter(
                'error',
                static function (string $string) {
                    return Message::error($string)->getDisplay();
                },
                ['is_safe' => ['html']]
            ),
            new TwigFilter(
                'raw_success',
                static function (string $string) {
                    return Message::rawSuccess($string)->getDisplay();
                },
                ['is_safe' => ['html']]
            ),
        ];
    }
}