From fc858f3ad255a913ff995355ed6375beb708913a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bouc=CC=8Cek?= Date: Wed, 20 Apr 2022 17:38:15 +0200 Subject: [PATCH] Fix comments, unify varname --- src/Escape.php | 26 +++++++++++++------------- src/EscapeCss.php | 3 +++ 2 files changed, 16 insertions(+), 13 deletions(-) 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 { /**