X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCore%2FRenderer.php;h=7f11f3f8e2a5ccd945692975675995711a04552e;hb=15eb8407928c24a96c17528304e23b0558c37bba;hp=879fdfe19e81ea83ceeb932e614e6fed1f5f10c0;hpb=8db0e090d7afc3fbfeaf7a587140c80c98233484;p=friendica.git diff --git a/src/Core/Renderer.php b/src/Core/Renderer.php index 879fdfe19e..7f11f3f8e2 100644 --- a/src/Core/Renderer.php +++ b/src/Core/Renderer.php @@ -1,6 +1,6 @@ 425, - 'videoheight' => 350, - 'stylesheet' => '', + 'videowidth' => 425, + 'videoheight' => 350, + 'stylesheet' => '', 'template_engine' => 'smarty3', ]; private static $ldelim = [ 'internal' => '', - 'smarty3' => '{{' + 'smarty3' => '{{' ]; private static $rdelim = [ 'internal' => '', - 'smarty3' => '}}' + 'smarty3' => '}}' ]; /** @@ -76,7 +76,7 @@ class Renderer DI::profiler()->startRecording('rendering'); // pass $baseurl to all templates if it isn't set - $vars = array_merge(['$baseurl' => DI::baseUrl()->get(), '$APP' => DI::app()], $vars); + $vars = array_merge(['$baseurl' => DI::baseUrl(), '$APP' => DI::app()], $vars); $t = self::getTemplateEngine(); @@ -101,10 +101,10 @@ class Renderer * @param string $file Template to load. * @param string $subDir Subdirectory (Optional) * - * @return string template. + * @return string Template * @throws ServiceUnavailableException */ - public static function getMarkupTemplate($file, $subDir = '') + public static function getMarkupTemplate(string $file, string $subDir = ''): string { DI::profiler()->startRecording('file'); $t = self::getTemplateEngine(); @@ -128,9 +128,11 @@ class Renderer * Register template engine class * * @param string $class + * + * @return void * @throws ServiceUnavailableException */ - public static function registerTemplateEngine($class) + public static function registerTemplateEngine(string $class) { $v = get_class_vars($class); @@ -156,7 +158,7 @@ class Renderer * @return TemplateEngine Template Engine instance * @throws ServiceUnavailableException */ - public static function getTemplateEngine() + public static function getTemplateEngine(): TemplateEngine { $template_engine = (self::$theme['template_engine'] ?? '') ?: 'smarty3'; @@ -185,7 +187,7 @@ class Renderer * * @return string the active template engine */ - public static function getActiveTemplateEngine() + public static function getActiveTemplateEngine(): string { return self::$theme['template_engine']; } @@ -194,8 +196,10 @@ class Renderer * sets the active template engine * * @param string $engine the template engine (default is Smarty3) + * + * @return void */ - public static function setActiveTemplateEngine($engine = 'smarty3') + public static function setActiveTemplateEngine(string $engine = 'smarty3') { self::$theme['template_engine'] = $engine; } @@ -211,7 +215,7 @@ class Renderer * * @return string the right delimiter */ - public static function getTemplateLeftDelimiter($engine = 'smarty3') + public static function getTemplateLeftDelimiter(string $engine = 'smarty3'): string { return self::$ldelim[$engine]; } @@ -227,7 +231,7 @@ class Renderer * * @return string the left delimiter */ - public static function getTemplateRightDelimiter($engine = 'smarty3') + public static function getTemplateRightDelimiter(string $engine = 'smarty3'): string { return self::$rdelim[$engine]; }