PHP Class HTMLPurifier_VarParser, yii

Mostrar archivo Open project: yiisoft/yii Class Usage Examples

Public Properties

Property Type Description
$stringTypes Lookup table of types that are string, and can have aliases or allowed value lists.
$types Lookup table of allowed types. Mainly for backwards compatibility, but also convenient for transforming string type names to the integer constants.

Public Methods

Method Description
getTypeName ( integer $type ) : string
parse ( mixed $var, integer $type, boolean $allow_null = false ) : string Validate a variable according to type.

Protected Methods

Method Description
error ( $msg ) Throws an exception.
errorGeneric ( mixed $var, integer $type ) Generic error for if a type didn't work.
errorInconsistent ( string $class, integer $type ) Throws an inconsistency exception.
parseImplementation ( mixed $var, integer $type, boolean $allow_null ) : string Actually implements the parsing. Base implementation does not do anything to $var. Subclasses should overload this!

Method Details

error() protected method

Throws an exception.
protected error ( $msg )

errorGeneric() protected method

Generic error for if a type didn't work.
protected errorGeneric ( mixed $var, integer $type )
$var mixed
$type integer

errorInconsistent() protected method

Throws an inconsistency exception.
protected errorInconsistent ( string $class, integer $type )
$class string
$type integer

getTypeName() public static method

public static getTypeName ( integer $type ) : string
$type integer
return string

parse() final public method

It may return NULL as a valid type if $allow_null is true.
final public parse ( mixed $var, integer $type, boolean $allow_null = false ) : string
$var mixed Variable to validate
$type integer Type of variable, see HTMLPurifier_VarParser->types
$allow_null boolean Whether or not to permit null as a value
return string Validated and type-coerced variable

parseImplementation() protected method

Actually implements the parsing. Base implementation does not do anything to $var. Subclasses should overload this!
protected parseImplementation ( mixed $var, integer $type, boolean $allow_null ) : string
$var mixed
$type integer
$allow_null boolean
return string

Property Details

$stringTypes public_oe static_oe property

Lookup table of types that are string, and can have aliases or allowed value lists.
public static $stringTypes

$types public_oe static_oe property

Lookup table of allowed types. Mainly for backwards compatibility, but also convenient for transforming string type names to the integer constants.
public static $types