public static getTypeName ( integer $type ) : string | ||
$type | integer | |
Résultat | string |
public static function getTypeName($type)
{
static $lookup;
if (!$lookup) {
// Lazy load the alternative lookup table
$lookup = array_flip(HTMLPurifier_VarParser::$types);
}
if (!isset($lookup[$type])) {
return 'unknown';
}
return $lookup[$type];
}
/** * Generic error for if a type didn't work. * @param mixed $var * @param int $type */ protected function errorGeneric($var, $type) { $vtype = gettype($var); $this->error("Expected type " . HTMLPurifier_VarParser::getTypeName($type) . ", got {$vtype}"); }