获取基本命名空间
@param string $type
@return bool|mixed
496907
public function getBaseNamespace($type = null)
    {
        if ($type === null) {
            $type = $this->type;
        }
        switch ($type) {
            case Module::TYPE_ADDON:
                return str_replace('/', '\\', ltrim(WechatModule::ADDON_MODULE_PATH, '@'));
            case Module::TYPE_CORE:
                return str_replace('/', '\\', ltrim(WechatModule::CORE_MODULE_PATH, '@'));
            default:
                return false;
        }
    }
507751
public function getFormClassName($type = null)
    {
        if (!$type) {
            $type = $this->getFormTypeDefault();
        }

        $module = $this->getRequest()->getModuleName();
        if (strpos($type, 'admin-') !== false) {
            $module = 'admin';
            $type = str_replace('admin-', '', $type);
        } elseif (strpos($type, 'default-') !== false) {
            $type = str_replace('default-', '', $type);
        }

        $name = ucfirst($module) . '_Forms_';
        $name .= $this->getFormClassNameSlug() . '_';
        $name .= inflector()->classify($type);

        return $name;
    }
296737
public function findOne($type = '')
    {
        $rows = $this->findAll($type)->asArray();

        return isset($rows[0]) ? $rows[0] : null;
    }
849386
public function getAsString(string $type): ?string
    {
        $ret = $this->entry[$type];
        if (is_array($ret)) {
            $ret = implode('', $ret);
        }
        return $ret;
    }
1029683
public function getNextOfType($type)
    {
        for (; $this->idx < $this->count; ++$this->idx) {
            if ($this->tokens[$this->idx]->type === $type) {
                return $this->tokens[$this->idx++];
            }
        }

        return null;
    }
1111159
public static function getUnknownActionName($type)
    {
        if (empty(self::$defaultActionNameWhenNotDefined)) {
            self::$defaultActionNameWhenNotDefined = Piwik::translate('General_NotDefined', Piwik::translate('Actions_ColumnPageName'));
            self::$defaultActionUrlWhenNotDefined = Piwik::translate('General_NotDefined', Piwik::translate('Actions_ColumnPageURL'));
        }
        if ($type == Action::TYPE_PAGE_TITLE) {
            return self::$defaultActionNameWhenNotDefined;
        }
        return self::$defaultActionUrlWhenNotDefined;
    }
1134597
public function getName($type)
    {
        $ref = new \ReflectionClass($this);
        foreach ($ref->getConstants() as $name => $value) {
            if ($value === $type) {
                return $name;
            }
        }

        throw new \InvalidArgumentException(sprintf('There is no token with value %s.', json_encode($type)));
    }
742221
public function getTypeName($type = null)
	{
		$group = $this->getGroup();
		$type  = $type === null ? $this->getType() : $type;

		return $GLOBALS['BOOTSTRAP']['wrappers'][$group][$type]['name'];
	}
380580
public static function truncateElementType(string $type): string
    {
        if (strpos($type, '<') === false) {
            return $type;
        }
        return substr($type, 0, strpos($type, '<'));
    }
1148264
public static function getCodeByType($type)
    {
        if (isset(self::$typeList[$type])) {
            return self::$typeList[$type];
        } else {
            return false;
        }
    }
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;
    }
797679
public static function getFilter(string $type): array
    {
        return isset(self::$filters[$type]) ? self::$filters[$type] : [];
    }
240047
protected function cleanType(?string $type): ?string
    {
        if (!$type || in_array(strtolower($type), ['null', 'mixed']) || strpos($type, '|')) {
            return null;
        }
        $lowerType = strtolower($type);
        if (in_array(ltrim($lowerType, '?'), [
            'array', 'int', 'integer', 'bool', 'boolean', 'float', 'double', 
            'real', 'string', 'object', 'unset', 'callback'
        ])) {
            return $lowerType;
        }
        return '\\' . ltrim($type, '\\');
    }
1000063
public function HasClassEnum($type)
    {   
        $components = $this->GetComponents($type);
        
        if($components->HasClass())
        {
            foreach($this->headers as $header_object)
            {
                if($components->HasNamespace())
                {
                    if(
                        isset(
                            $header_object->namespaces[$components->namespace]
                                ->classes[$components->class]
                                ->enumerations[$components->type]
                        )
                    )
                        return $header_object->namespaces[$components->namespace]
                            ->classes[$components->class]
                            ->enumerations[$components->type]
                        ;
                }
                else
                {
                    if(
                        isset(
                            $header_object->namespaces["\\"]
                                ->classes[$components->class]
                                ->enumerations[$components->type]
                        )
                    )
                        return $header_object->namespaces["\\"]
                            ->classes[$components->class]
                            ->enumerations[$components->type]
                        ;
                }
            }
        }
        
        return null;
    }
1131638
public function hasType($type)
    {
        if ($type instanceof Type) {
            $type = $type->getName();
        }

        return \in_array($type, $this->_types);
    }
242312
public static function getType($type)
    {
        $type = strtolower($type);

        if (!isset(static::$typeMapping[$type])) {
            return $type;
        }

        return static::$typeMapping[$type];
    }
1202323
public static function getTypeName($type = null)
    {
        $result = [
            Item::TYPE_PERMISSION => 'Permission',
            Item::TYPE_ROLE => 'Role',
        ];
        if ($type === null) {
            return $result;
        }

        return $result[$type];
    }