From aae3cc3a0660816993c04ea11e89e190519e0ac2 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 15 Feb 2018 20:44:57 +0100 Subject: [PATCH] Type cast fixes --- Localization/L11nManager.php | 8 ++++---- Views/View.php | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Localization/L11nManager.php b/Localization/L11nManager.php index dca8d8515..cf2efe668 100644 --- a/Localization/L11nManager.php +++ b/Localization/L11nManager.php @@ -141,13 +141,13 @@ class L11nManager * @param string $code Country code * @param string $module Module name * @param string $theme Theme - * @param string $translation Text + * @param mixed $translation Text * * @return string In case the language element couldn't be found 'ERROR' will be returned * * @since 1.0.0 */ - public function getText(string $code, string $module, string $theme, string $translation) : string + public function getText(string $code, string $module, string $theme, $translation) : string { if (!isset($this->language[$code][$module][$translation])) { try { @@ -176,13 +176,13 @@ class L11nManager * @param string $code Country code * @param string $module Module name * @param string $theme Theme - * @param string $translation Text + * @param mixed $translation Text * * @return string In case the language element couldn't be found 'ERROR' will be returned * * @since 1.0.0 */ - public function getHtml(string $code, string $module, string $theme, string $translation) : string + public function getHtml(string $code, string $module, string $theme, $translation) : string { return htmlspecialchars($this->getText($code, $module, $theme, $translation)); } diff --git a/Views/View.php b/Views/View.php index f8aebd4e1..53d83f715 100644 --- a/Views/View.php +++ b/Views/View.php @@ -161,7 +161,7 @@ class View extends ViewAbstract /** * Get translation. * - * @param string $translation Text + * @param mixed $translation Text * @param string $module Module name * @param string $theme Theme name * @@ -172,7 +172,7 @@ class View extends ViewAbstract * * @since 1.0.0 */ - public function getText(string $translation, string $module = null, string $theme = null) : string + public function getText($translation, string $module = null, string $theme = null) : string { if (!isset($module)) { $match = '/Modules/'; @@ -204,7 +204,7 @@ class View extends ViewAbstract /** * Get translation. * - * @param string $translation Text + * @param mixed $translation Text * @param string $module Module name * @param string $theme Theme name * @@ -212,7 +212,7 @@ class View extends ViewAbstract * * @since 1.0.0 */ - public function getHtml(string $translation, string $module = null, string $theme = null) : string + public function getHtml($translation, string $module = null, string $theme = null) : string { return htmlspecialchars($this->getText($translation, $module, $theme)); } @@ -220,15 +220,15 @@ class View extends ViewAbstract /** * Print html output. * - * @param string $text Text + * @param mixed $text Text * * @return string * * @since 1.0.0 */ - public function printHtml(string $text) : string + public function printHtml($text) : string { - return htmlspecialchars($text); + return htmlspecialchars((string) $text); } /**