phpmyadmin/libraries/classes/Display/Error.php
Maurício Meneghini Fauth 206199105e Remove useless return type annotations
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
2020-01-23 13:03:29 -03:00

51 lines
1.2 KiB
PHP

<?php
/**
* Displays Error
*/
declare(strict_types=1);
namespace PhpMyAdmin\Display;
use PhpMyAdmin\Sanitize;
use PhpMyAdmin\Template;
use Throwable;
use Twig_Error_Loader;
use Twig_Error_Runtime;
use Twig_Error_Syntax;
/**
* Displays Error
*/
class Error
{
/**
* @param Template $template Template object used to render the error
* @param string $lang Lang of the HTML page
* @param string $dir Direction of text of the HTML page
* @param string $errorHeader Error header
* @param string $errorMessage Error message
*
* @throws Throwable
* @throws Twig_Error_Loader
* @throws Twig_Error_Runtime
* @throws Twig_Error_Syntax
*/
public static function display(
Template $template,
string $lang,
string $dir,
string $errorHeader,
string $errorMessage
): string {
return $template->render(
'error/generic',
[
'lang' => $lang,
'dir' => $dir,
'error_header' => $errorHeader,
'error_message' => Sanitize::sanitizeMessage($errorMessage),
]
);
}
}