public static function typecast(&$value, $type)
    {
        switch ($type) {
            case Validate::TYPE_INT:
            case Validate::TYPE_UINT:
                $value = intval($value);
                break;
            case Validate::TYPE_FLOAT:
                $value = floatval($value);
                break;
            case Validate::TYPE_DOUBLE:
                $value = doubleval($value);
                break;
            case Validate::TYPE_BOOLEAN:
                $value = boolval($value);
                break;
            case Validate::TYPE_UNIX_TIMESTAMP:
                //Add the timezone offset (in minutes)
                $value = intval($value) +
                    (\Phramework\Phramework::getTimezoneOffset()*60);
                break;
        }
    }