Skip to content

Commit

Permalink
Merge pull request #7 from jakubboucek/jb-fix-typos
Browse files Browse the repository at this point in the history
Fix comments, unify varname
  • Loading branch information
jakubboucek authored Apr 20, 2022
2 parents 159158b + fc858f3 commit 863f13b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/Escape.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
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
*/
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
*
Expand Down Expand Up @@ -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
Expand All @@ -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
*
Expand All @@ -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
*/
Expand Down
3 changes: 3 additions & 0 deletions src/EscapeCss.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

namespace JakubBoucek\Escape;

/**
* Escape functions for CSS entities.
*/
class EscapeCss
{
/**
Expand Down

0 comments on commit 863f13b

Please sign in to comment.