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. |
Method | Description | |
---|---|---|
getTypeName ( integer $type ) : string | ||
parse ( mixed $var, integer $type, boolean $allow_null = false ) : string | Validate a variable according to type. |
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! |
protected errorGeneric ( mixed $var, integer $type ) | ||
$var | mixed | |
$type | integer |
protected errorInconsistent ( string $class, integer $type ) | ||
$class | string | |
$type | integer |
public static getTypeName ( integer $type ) : string | ||
$type | integer | |
return | string |
public static $stringTypes |