final class Escaper

Context-aware escaping.

Constants

Text

JavaScript

Css

ICal

Url

HtmlText

HtmlComment

HtmlBogusTag

HtmlCss

HtmlJavaScript

HtmlTag

HtmlAttribute

Methods

__construct(string $contentType)

No description

string
getContentType()

No description

string
getState()

No description

string
export()

No description

void
enterContentType(string $type)

No description

void
enterHtmlText(ElementNode|null $node)

No description

void
enterHtmlTag(string $name)

No description

void
enterHtmlAttribute(string|null $name = null, string $quote = '')

No description

void
enterHtmlAttributeQuote(string $quote = '"')

No description

void
enterHtmlBogusTag()

No description

void
enterHtmlComment()

No description

string
escape(string $str)

No description

string
check(string $str)

No description

static callable|null
getConvertor(string $source, string $dest)

No description

Details

at line 47
__construct(string $contentType)

No description

Parameters

string $contentType

at line 54
string getContentType()

No description

Return Value

string

at line 60
string getState()

No description

Return Value

string

at line 66
string export()

No description

Return Value

string

at line 73
void enterContentType(string $type)

No description

Parameters

string $type

Return Value

void

at line 79
void enterHtmlText(ElementNode|null $node)

No description

Parameters

ElementNode|null $node

Return Value

void

at line 97
void enterHtmlTag(string $name)

No description

Parameters

string $name

Return Value

void

at line 104
void enterHtmlAttribute(string|null $name = null, string $quote = '')

No description

Parameters

string|null $name
string $quote

Return Value

void

at line 125
void enterHtmlAttributeQuote(string $quote = '"')

No description

Parameters

string $quote

Return Value

void

at line 131
void enterHtmlBogusTag()

No description

Return Value

void

at line 137
void enterHtmlComment()

No description

Return Value

void

at line 143
string escape(string $str)

No description

Parameters

string $str

Return Value

string

at line 179
string check(string $str)

No description

Parameters

string $str

Return Value

string

at line 188
static callable|null getConvertor(string $source, string $dest)

No description

Parameters

string $source
string $dest

Return Value

callable|null

Traits

Better OOP experience.