Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix comments, unify varname #7

Merged
merged 1 commit into from
Apr 20, 2022
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
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