Returns prefix for variable according to variable type

@param string $strType The type of variable for which the prefix is needed

@return string The variable prefix

@was QString::PrefixFromType
542145
public static function prefixFromType($strType)
    {
        switch ($strType) {
            case Type::ARRAY_TYPE:
                return "obj";
            case Type::BOOLEAN:
                return "bln";
            case Type::DATE_TIME:
                return "dtt";
            case Type::FLOAT:
                return "flt";
            case Type::INTEGER:
                return "int";
            case Type::OBJECT:
                return "obj";
            case Type::STRING:
                return "str";
        }
        // Suppressing the IDE warning about no value being return
        return "";
    }
618273
private function parseType($type)
    {
        $dataType = '';
        $length = 0;
        $data = '';
        $tmp = '';
        if (strpos($type, '(') !== false) {
            for ($i = 0; $i < strlen($type); $i++) {
                $str = $type{$i};
                if ($str == '(') {
                    $dataType = $tmp;
                    $tmp = '';
                    continue;
                }
                if ($str == ')') {
                    $data = $tmp;
                    $tmp = '';
                    continue;
                }
                $tmp .= $str;
            }
        } else {
            $dataType = $type;
        }

        switch ($dataType) {
            case 'set':
                $data = str_replace(['"', "'"], '', $data);
                $data = explode(',', $data);
                break;
            case 'decimal':
                $length = explode(',', $data);
                $data = '';
                break;
            default:
                $length = intval($data);
                $data = '';
                break;
        }

        return [$dataType, $length, $data];
    }
84421
private function getLongTypeFromType(string $type): string
    {
        $reflection = new \ReflectionObject($this);
        foreach ($reflection->getConstants() as $const => $value) {
            if (0 === strpos($const, 'TYPE_')) {
                if ($type === $value) {
                    return strtolower(substr($const, 5));
                }
            }
        }

        return 'info';
    }
849386
public function getAsString(string $type): ?string
    {
        $ret = $this->entry[$type];
        if (is_array($ret)) {
            $ret = implode('', $ret);
        }
        return $ret;
    }
578363
public static function getType($var){
        if(is_int($var)){
            return self::T_INTEGER;
        }else if(is_string($var)){
            return self::T_STRING;
        }else if(is_float($var)){
            return self::T_FLOAT;
        }else if(is_bool($var)){
            return self::T_BOOLEAN;
        }else if(is_array($var)){
            return self::T_ARRAY;
        }else if(is_object($var)){
            return self::T_OBJECT;
        }else if(is_resource($var)){
            return self::T_RESOURCE;
        }else if($var === null){
            return self::T_NULL;
        }
        
        return self::T_UNKNOWN;
    }
263583
public static function nameShape($type)
    {
        if (isset(self::$shape_names[$type])) {
            return self::$shape_names[$type];
        }

        return sprintf('Shape %d', $type);
    }
1293214
public function mapType($ctype)
    {
        if (is_array($ctype)) {
            return array_map([$this, 'mapType'], $ctype);
        }

        foreach ($this->_mimeTypes as $alias => $types) {
            if (in_array($ctype, (array)$types)) {
                return $alias;
            }
        }

        return null;
    }
76232
protected function getTypeByCode($type)
    {
        switch ($type) {
            case self::BOOLEAN:
                return 'boolean';
            case self::INT:
                return 'int';
            case self::FLOAT:
                return 'float';
            case self::STRING:
                return 'string';
            case self::DATE:
                return 'date';
            case self::OBJECT:
                return 'object';
            case self::XML:
                return 'xml';
            case self::DATA:
                return 'data';
            case self::DATA_ARRAY:
                return 'array';

            default:
                return null;
        }
    }
433270
private function getTypeName($name)
    {
        if (!$name) {
            return null;
        }

        if (is_string($name)) {
            return $name;
        }

        $prefix = '';
        if ($name instanceof NullableType) {
            $name   = $name->type;
            $prefix = '?';
        }

        return $prefix . $this->getFullClassName($name);
    }
42673
private function prefixBillTypes($types, $prefix = '-- ')
    {
        foreach ($types as $key => $title) {
            if (count(explode(',', $key)) > 1) {
                $types[$key] = $prefix . $title;
            }
        }

        return $types;
    }
1223600
public static function variable($string)
    {
        if (!($result = self::_cache(__FUNCTION__, $string))) {
            $camelized = Inflector::camelize(Inflector::underscore($string));
            $replace = strtolower(substr($camelized, 0, 1));
            $result = preg_replace('/\\w/', $replace, $camelized, 1);
            self::_cache(__FUNCTION__, $string, $result);
        }
        return $result;
    }
467393
public static function nameByType($type)
    {
        switch ($type) {
            case self::TOKEN_BOOLEAN_FALSE: return 'BOOLEAN_FALSE';
            case self::TOKEN_BOOLEAN_TRUE: return 'BOOLEAN_TRUE';
            case self::TOKEN_BRACE_CLOSE: return 'BRACE_CLOSE';
            case self::TOKEN_BRACE_OPEN: return 'BRACE_OPEN';
            case self::TOKEN_COLON: return 'COLON';
            case self::TOKEN_COMMA: return 'COMMA';
            case self::TOKEN_FLOAT: return 'FLOAT';
            case self::TOKEN_GREATER_THAN: return 'GREATER_THAN';
            case self::TOKEN_INTEGER: return 'INTEGER';
            case self::TOKEN_LESS_THAN: return 'LESS_THAN';
            case self::TOKEN_NULL: return 'NULL';
            case self::TOKEN_PIPE: return 'PIPE';
            case self::TOKEN_PLUS: return 'PLUS';
            case self::TOKEN_SQUARE_BRACKET_CLOSE:
                return 'SQUARE_BRACKET_CLOSE';
            case self::TOKEN_SQUARE_BRACKET_OPEN: return 'SQUARE_BRACKET_OPEN';
            case self::TOKEN_STRING: return 'STRING';
            case self::TOKEN_STRING_QUOTED: return 'STRING_QUOTED';
            case self::TOKEN_TYPE_NAME: return 'TYPE_NAME';
            case self::TOKEN_WHITESPACE: return 'WHITESPACE';
        }

        return null;
    }
1288663
public function get($sType)
    {
        $sType = strtoupper(trim($sType));

        if (!empty($this->aMessages[$sType])) {

            return $this->aMessages[$sType];

        } else {

            return '';
        }
    }
1088995
public function getPrefix($suffix = null)
    {
        $prefix = $this->console->option('prefix');

        return $prefix ? $prefix.$suffix : null;
    }
207842
public static function getTypeName($type)
    {
        switch ($type) {
            case self::IFD0:
                return '0';
            case self::IFD1:
                return '1';
            case self::EXIF:
                return 'Exif';
            case self::GPS:
                return 'GPS';
            case self::INTEROPERABILITY:
                return 'Interoperability';
            case self::CANON_MAKER_NOTES:
                return 'Canon Maker Notes';
            case self::CANON_CAMERA_SETTINGS:
                return 'Canon Camera Settings';
            case self::CANON_SHOT_INFO:
                return 'Canon Shot Information';
            case self::CANON_PANORAMA:
                return 'Canon Panorama Information';
            case self::CANON_PICTURE_INFO:
                return 'Canon Picture Information';
            case self::CANON_FILE_INFO:
                return 'Canon File Information';
            case self::CANON_CUSTOM_FUNCTIONS:
                return 'Canon Custom Functions';
            default:
                throw new PelIfdException('Unknown IFD type: %d', $type);
        }
    }
1306114
public static function fetchType($type): string
    {
        if(\is_int($type)) {
            switch($type) {
                case self::TYPE_UNKNOWN:
                    return "unknown";
                case self::TYPE_INT:
                    return "integer";
                case self::TYPE_LONG:
                    return "long";
                case self::TYPE_SHORT:
                    return "short";
                case self::TYPE_BOOLEAN:
                    return "boolean";
                case self::TYPE_FLOAT:
                    return "float";
                case self::TYPE_STRING:
                    return "string";
                case self::TYPE_CHAR:
                    return "char";
                case self::TYPE_VARCHAR:
                    return "varchar";
                case self::TYPE_ARRAY:
                    return "array";
                case self::TYPE_OBJECT:
                    return "object";
                case self::TYPE_DATE:
                    return "date";
            }
        }
        return (string) $type;
    }
1065335
private function extractFieldTypeLength(&$strFieldType)
    {
        $len = explode(')', $strFieldType);
        $len = explode('(', $len[0]);

        return (int)(count($len) > 1 ? $len[1] : null);
    }