diff options
Diffstat (limited to 'lib/Minz/Helper.php')
-rw-r--r-- | lib/Minz/Helper.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/Minz/Helper.php b/lib/Minz/Helper.php index 04539ec40..50243ded0 100644 --- a/lib/Minz/Helper.php +++ b/lib/Minz/Helper.php @@ -9,23 +9,25 @@ declare(strict_types=1); /** * The Minz_Helper class contains some misc. help functions */ -class Minz_Helper { +final class Minz_Helper { /** * Wrapper for htmlspecialchars. - * Force UTf-8 value and can be used on array too. + * Force UTF-8 value and can be used on array too. * - * @phpstan-template T of string|array<mixed> + * @phpstan-template T of mixed * @phpstan-param T $var * @phpstan-return T * - * @param string|array<mixed> $var - * @return string|array<mixed> + * @param mixed $var + * @return mixed */ public static function htmlspecialchars_utf8($var) { if (is_array($var)) { - return array_map(['Minz_Helper', 'htmlspecialchars_utf8'], $var); + // @phpstan-ignore argument.type, return.type + return array_map([self::class, 'htmlspecialchars_utf8'], $var); } elseif (is_string($var)) { + // @phpstan-ignore return.type return htmlspecialchars($var, ENT_COMPAT, 'UTF-8'); } else { return $var; |