Type cast fixes

This commit is contained in:
Dennis Eichhorn 2018-02-15 20:44:57 +01:00
parent f1121dcc9b
commit aae3cc3a06
2 changed files with 11 additions and 11 deletions

View File

@ -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));
}

View File

@ -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);
}
/**