PHP Класс HTMLPurifier_VarParser, yii

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$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.

Открытые методы

Метод Описание
getTypeName ( integer $type ) : string
parse ( mixed $var, integer $type, boolean $allow_null = false ) : string Validate a variable according to type.

Защищенные методы

Метод Описание
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!

Описание методов

error() защищенный метод

Throws an exception.
protected error ( $msg )

errorGeneric() защищенный метод

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

errorInconsistent() защищенный метод

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

getTypeName() публичный статический метод

public static getTypeName ( integer $type ) : string
$type integer
Результат string

parse() закрытый публичный метод

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
Результат string Validated and type-coerced variable

parseImplementation() защищенный метод

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
Результат string

Описание свойств

$stringTypes публичное статическое свойство

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

$types публичное статическое свойство

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