Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
43 changes: 0 additions & 43 deletions src/Security.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ class Security
* - UTF-8
* - Windows-1251
* - Windows-1252.
*
* @return array
*/
protected static function generateSupportedCharsets(): array
{
Expand All @@ -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
{
Expand All @@ -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
Expand All @@ -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
{
Expand Down Expand Up @@ -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
{
Expand All @@ -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
{
Expand All @@ -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
{
Expand Down Expand Up @@ -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
{
Expand Down Expand Up @@ -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
{
Expand All @@ -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
{
Expand Down
15 changes: 0 additions & 15 deletions tests/SecurityTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,6 @@ public static function dataCSS(): array
/**
* @dataProvider dataHTML
*
* @param string $input
* @param string $expected
*
* @throws SecurityException
*/
#[DataProvider('dataHTML')]
Expand All @@ -220,9 +217,6 @@ public function testEscHTML(string $input, string $expected): void
/**
* @dataProvider dataAttr
*
* @param string $input
* @param string $expected
*
* @throws SecurityException
*/
#[DataProvider('dataAttr')]
Expand All @@ -234,9 +228,6 @@ public function testEscAttr(string $input, string $expected): void
/**
* @dataProvider dataJS
*
* @param string $input
* @param string $expected
*
* @throws SecurityException
*/
#[DataProvider('dataJS')]
Expand All @@ -248,9 +239,6 @@ public function testEscJS(string $input, string $expected): void
/**
* @dataProvider dataURL
*
* @param string $input
* @param string $expected
*
* @throws SecurityException
*/
#[DataProvider('dataURL')]
Expand All @@ -262,9 +250,6 @@ public function testEscURL(string $input, string $expected): void
/**
* @dataProvider dataCSS
*
* @param string $input
* @param string $expected
*
* @throws SecurityException
*/
#[DataProvider('dataCSS')]
Expand Down