diff --git a/src/Escape.php b/src/Escape.php index cf8e403..5109d01 100644 --- a/src/Escape.php +++ b/src/Escape.php @@ -10,8 +10,8 @@ use RuntimeException; /** - * Escape funxtions. Uses UTF-8 only. - * Substrate of Filters class from Latte/Latte package + * Escape functions. Uses UTF-8 only. + * Substrate of Filters class from Latte/Latte package. * * @link https://latte.nette.org/ * @link https://api.nette.org/2.4/source-Latte.Runtime.Filters.php.html#Filters @@ -19,7 +19,7 @@ class Escape { /** - * Escapes string for use everywhere inside HTML (except for comments) + * Escapes string for use everywhere inside HTML (except for comments). * @param string|HtmlStringable|IHtmlString|mixed $data * @return string * @@ -87,8 +87,8 @@ public static function xml($data): string } /** - * Escapes string for use inside JS code - * @param mixed $data + * Escapes string for use inside JS code. + * @param string|HtmlStringable|IHtmlString|mixed $data * @return string * * @link https://api.nette.org/2.4/source-Latte.Runtime.Filters.php.html#_escapeJs @@ -109,7 +109,7 @@ public static function js($data): string } /** - * Escapes string for use inside CSS code + * Escapes string for use inside CSS code. * @param string|mixed $data * @return string * @@ -123,19 +123,19 @@ public static function css($data): string } /** - * Escapes string for use inside URL - * @param string|mixed $url + * Escapes string for use inside URL. + * @param string|mixed $data * @return string */ - public static function url($url): string + public static function url($data): string { - $url = (string)$url; - return urlencode($url); + $data = (string)$data; + return urlencode($data); } /** - * Just returns argument as is without any escaping - * Method is useful to mark code as intentionally unescaped as opposed to simple neglected + * Just returns argument as is without any escaping. + * Method is useful to mark code as intentionally unescaped as opposed to simple neglected. * @param string|mixed $data * @return string */ diff --git a/src/EscapeCss.php b/src/EscapeCss.php index 8c4c6b1..725253d 100644 --- a/src/EscapeCss.php +++ b/src/EscapeCss.php @@ -5,6 +5,9 @@ namespace JakubBoucek\Escape; +/** + * Escape functions for CSS entities. + */ class EscapeCss { /**