HumHub Documentation (unofficial)

HTMLPurifier_TokenFactory
in package

Factory for token generation.

Tags
note

Doing some benchmarking indicates that the new operator is much slower than the clone operator (even discounting the cost of the constructor). This class is for that optimization. Other then that, there's not much point as we don't maintain parallel HTMLPurifier_Token hierarchies (the main reason why you'd want to use an abstract factory).

todo

Port DirectLex to use this

Table of Contents

Properties

$p_comment  : mixed
$p_empty  : mixed
$p_end  : mixed
$p_start  : mixed
$p_text  : mixed

Methods

__construct()  : mixed
Generates blank prototypes for cloning.
createComment()  : HTMLPurifier_Token_Comment
Creates a HTMLPurifier_Token_Comment.
createEmpty()  : HTMLPurifier_Token_Empty
Creates a HTMLPurifier_Token_Empty.
createEnd()  : HTMLPurifier_Token_End
Creates a HTMLPurifier_Token_End.
createStart()  : HTMLPurifier_Token_Start
Creates a HTMLPurifier_Token_Start.
createText()  : HTMLPurifier_Token_Text
Creates a HTMLPurifier_Token_Text.

Properties

$p_comment

private mixed $p_comment
Tags
type

HTMLPurifier_Token_Comment

$p_empty

private mixed $p_empty
Tags
type

HTMLPurifier_Token_Empty

$p_end

private mixed $p_end
Tags
type

HTMLPurifier_Token_End

$p_start

private mixed $p_start
Tags
type

HTMLPurifier_Token_Start

$p_text

private mixed $p_text
Tags
type

HTMLPurifier_Token_Text

Methods

__construct()

Generates blank prototypes for cloning.

public __construct() : mixed

createEmpty()

Creates a HTMLPurifier_Token_Empty.

public createEmpty(string $name[, array<string|int, mixed> $attr = array() ]) : HTMLPurifier_Token_Empty
Parameters
$name : string

Tag name

$attr : array<string|int, mixed> = array()

Associative array of attributes

Return values
HTMLPurifier_Token_Empty

Generated HTMLPurifier_Token_Empty

createStart()

Creates a HTMLPurifier_Token_Start.

public createStart(string $name[, array<string|int, mixed> $attr = array() ]) : HTMLPurifier_Token_Start
Parameters
$name : string

Tag name

$attr : array<string|int, mixed> = array()

Associative array of attributes

Return values
HTMLPurifier_Token_Start

Generated HTMLPurifier_Token_Start


        
On this page

Search results