From a7c428aa942c400515175229cbe96172549d5175 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sat, 26 Jun 2021 16:21:02 +0200 Subject: [PATCH] Removed unnecessary docblocks and imports from #23 Since we now use native parameter type declarations, we no longer need to have `@param string $param` declarations. Also, `is_string()` and `gettype()` are no longer in use (were used when throwing an exception based on invalid input). Note that `@return string` is preserved: we cannot introduce native return type declarations, as that would lead to downstream crashes in inheritance scenarios, when the consumer didn't declare `: string` return types themselves too. --- src/Escaper.php | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/Escaper.php b/src/Escaper.php index 7e4421ea..ca0f1a9d 100644 --- a/src/Escaper.php +++ b/src/Escaper.php @@ -7,12 +7,10 @@ use function bin2hex; use function ctype_digit; use function function_exists; -use function gettype; use function hexdec; use function htmlspecialchars; use function iconv; use function in_array; -use function is_string; use function mb_convert_encoding; use function ord; use function preg_match; @@ -132,7 +130,6 @@ class Escaper * Constructor: Single parameter allows setting of global encoding for use by * the current object. * - * @param string|null $encoding * @throws Exception\InvalidArgumentException */ public function __construct(?string $encoding = null) @@ -178,7 +175,6 @@ public function getEncoding() * Escape a string for the HTML Body context where there are very few characters * of special meaning. Internally this will use htmlspecialchars(). * - * @param string $string * @return string */ public function escapeHtml(string $string) @@ -191,7 +187,6 @@ public function escapeHtml(string $string) * to escape that are not covered by htmlspecialchars() to cover cases where an attribute * might be unquoted or quoted illegally (e.g. backticks are valid quotes for IE). * - * @param string $string * @return string */ public function escapeHtmlAttr(string $string) @@ -214,7 +209,6 @@ public function escapeHtmlAttr(string $string) * Backslash escaping is not used as it still leaves the escaped character as-is and so * is not useful in a HTML context. * - * @param string $string * @return string */ public function escapeJs(string $string) @@ -233,7 +227,6 @@ public function escapeJs(string $string) * an entire URI - only a subcomponent being inserted. The function is a simple proxy * to rawurlencode() which now implements RFC 3986 since PHP 5.3 completely. * - * @param string $string * @return string */ public function escapeUrl(string $string) @@ -245,7 +238,6 @@ public function escapeUrl(string $string) * Escape a string for the CSS context. CSS escaping can be applied to any string being * inserted into CSS and escapes everything except alphanumerics. * - * @param string $string * @return string */ public function escapeCss(string $string)