diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 2f50af3..29bc473 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -30,7 +30,7 @@ ] ], 'no_php4_constructor' => true, - 'no_superfluous_phpdoc_tags' => false, + 'no_superfluous_phpdoc_tags' => true, 'no_unreachable_default_argument_value' => true, 'no_useless_else' => true, 'no_useless_return' => true, diff --git a/src/Security.php b/src/Security.php index 3d7db60..5ddfe0e 100644 --- a/src/Security.php +++ b/src/Security.php @@ -40,8 +40,6 @@ class Security * - UTF-8 * - Windows-1251 * - Windows-1252. - * - * @return array */ protected static function generateSupportedCharsets(): array { @@ -64,10 +62,6 @@ protected static function generateSupportedCharsets(): array /** * Checks if charset is supported. - * - * @param string $charset - * - * @return bool */ public static function isSupportedCharset(string $charset): bool { @@ -91,8 +85,6 @@ public static function isSupportedCharset(string $charset): bool /** * Throws Security Exception if charset is not supported. * - * @param string $charset - * * @throws SecurityException */ protected static function throwExceptionIfCharsetIsUnsupported(string $charset): void @@ -105,12 +97,7 @@ protected static function throwExceptionIfCharsetIsUnsupported(string $charset): /** * Converts string from any charset to UTF-8. * - * @param mixed $string - * @param string $charset - * * @throws SecurityException - * - * @return string */ protected static function convertStringToUTF8($string, string $charset = 'UTF-8'): string { @@ -139,11 +126,6 @@ protected static function convertStringToUTF8($string, string $charset = 'UTF-8' /** * Converts string from UTF-8 to any charset. - * - * @param mixed $string - * @param string $charset - * - * @return string */ protected static function convertStringFromUTF8($string, string $charset = 'UTF-8'): string { @@ -159,12 +141,7 @@ protected static function convertStringFromUTF8($string, string $charset = 'UTF- /** * Escapes text for HTML output. * - * @param mixed $text - * @param string $charset - * * @throws SecurityException - * - * @return string */ public static function escHTML($text, string $charset = 'UTF-8'): string { @@ -179,12 +156,7 @@ public static function escHTML($text, string $charset = 'UTF-8'): string /** * Escapes text for HTML attribute output. * - * @param mixed $text - * @param string $charset - * * @throws SecurityException - * - * @return string */ public static function escAttr($text, string $charset = 'UTF-8'): string { @@ -225,12 +197,7 @@ public static function escAttr($text, string $charset = 'UTF-8'): string /** * Escapes text for JS output. * - * @param mixed $text - * @param string $charset - * * @throws SecurityException - * - * @return string */ public static function escJS($text, string $charset = 'UTF-8'): string { @@ -275,12 +242,7 @@ public static function escJS($text, string $charset = 'UTF-8'): string /** * Escapes text for URL output. * - * @param mixed $text - * @param string $charset - * * @throws SecurityException - * - * @return string */ public static function escURL($text, string $charset = 'UTF-8'): string { @@ -294,12 +256,7 @@ public static function escURL($text, string $charset = 'UTF-8'): string /** * Escapes text for CSS output. * - * @param mixed $text - * @param string $charset - * * @throws SecurityException - * - * @return string */ public static function escCSS($text, string $charset = 'UTF-8'): string { diff --git a/tests/SecurityTest.php b/tests/SecurityTest.php index c06607c..0f9bda0 100644 --- a/tests/SecurityTest.php +++ b/tests/SecurityTest.php @@ -206,9 +206,6 @@ public static function dataCSS(): array /** * @dataProvider dataHTML * - * @param string $input - * @param string $expected - * * @throws SecurityException */ #[DataProvider('dataHTML')] @@ -220,9 +217,6 @@ public function testEscHTML(string $input, string $expected): void /** * @dataProvider dataAttr * - * @param string $input - * @param string $expected - * * @throws SecurityException */ #[DataProvider('dataAttr')] @@ -234,9 +228,6 @@ public function testEscAttr(string $input, string $expected): void /** * @dataProvider dataJS * - * @param string $input - * @param string $expected - * * @throws SecurityException */ #[DataProvider('dataJS')] @@ -248,9 +239,6 @@ public function testEscJS(string $input, string $expected): void /** * @dataProvider dataURL * - * @param string $input - * @param string $expected - * * @throws SecurityException */ #[DataProvider('dataURL')] @@ -262,9 +250,6 @@ public function testEscURL(string $input, string $expected): void /** * @dataProvider dataCSS * - * @param string $input - * @param string $expected - * * @throws SecurityException */ #[DataProvider('dataCSS')]