Get a human-readable name of the given token type.

@param integer $type
@return string
354454
public static function getTypeName($type)
	{
		static $ref = [];
		
		$key = static::class;
		
		if(empty($ref[$key]))
		{
			$ref[$key] = new \ReflectionClass($key);
		}
		
		foreach($ref[$key]->getConstants() as $k => $v)
		{
			if($v === $type && strpos($k, 'T_') === 0)
			{
				return $k;
			}
		}

		return static::UNKNOWN;
	}
1095872
private static function get_cookie_name($type=null) {
	if (is_null($type)) {
		$type = $_SESSION['_session_type'];
	}
	
	return self::COOKIE_NAME_PREFIX.'-'.$type;
}
910670
public static function humanize($type)
    {
        $class = new ReflectionClass(static::class);

        $types = [];

        foreach ($class->getConstants() as $constant => $value) {
            if (($value & $type) === $value) {
                $types[] = $constant;
            }
        }

        return $types ? implode(' | ', $types) : '?';
    }
427368
function token_name ( $t ){
		$t = self::token_to_symbol( $t );
		if( ! is_int($t) ){
			return $t;
		}
		return $this->Lex->name( $t );
	}
729386
protected function _getInheritanceTypeString($type)
    {
        switch ($type) {
            case ClassMetadataInfo::INHERITANCE_TYPE_NONE:
                return 'NONE';

            case ClassMetadataInfo::INHERITANCE_TYPE_JOINED:
                return 'JOINED';

            case ClassMetadataInfo::INHERITANCE_TYPE_SINGLE_TABLE:
                return 'SINGLE_TABLE';

            case ClassMetadataInfo::INHERITANCE_TYPE_TABLE_PER_CLASS:
                return 'PER_CLASS';
        }
    }
1341193
public static function getTokenSyntax($tokenType)
    {
        $tokenSyntax = array();
        // Punctuation
        if ($tokenType & self::T_COMMA) {
            $tokenSyntax[] = ',';
        }

        // Recognize numeric values
        if ($tokenType & self::T_FLOAT) {
            $tokenSyntax[] = 'simple float';
        }
        if ($tokenType & self::T_INTEGER) {
            $tokenSyntax[] = 'simple integer';
        }
        if ($tokenType & self::T_INPUT_PARAMETER) {
            $tokenSyntax[] = '/[a-z_][a-z0-9_]*/';
        }

        // Recognize quoted strings
        if ($tokenType & self::T_STRING) {
            $tokenSyntax[] = '"value" or \'value\'';
        }

        // Comparison operator
        if ($tokenType & self::T_EQUALS) {
            $tokenSyntax[] = '=';
        }
        if ($tokenType & self::T_NOT_EQUALS) {
            $tokenSyntax[] = '≠ or !=';
        }
        if ($tokenType & self::T_GREATER_THAN) {
            $tokenSyntax[] = '>';
        }
        if ($tokenType & self::T_GREATER_THAN_EQUALS) {
            $tokenSyntax[] = '≥ or >=';
        }
        if ($tokenType & self::T_LOWER_THAN) {
            $tokenSyntax[] = '<';
        }
        if ($tokenType & self::T_LOWER_THAN_EQUALS) {
            $tokenSyntax[] = '≤ or <=';
        }

        // Composite operator
        if ($tokenType & self::T_AND) {
            $tokenSyntax[] = '&';
        }
        if ($tokenType & self::T_NOT_AND) {
            $tokenSyntax[] = '!&';
        }
        if ($tokenType & self::T_OR) {
            $tokenSyntax[] = '|';
        }
        if ($tokenType & self::T_NOT_OR) {
            $tokenSyntax[] = '!|';
        }
        if ($tokenType & self::T_XOR) {
            $tokenSyntax[] = '⊕ or ^|';
        }

        // Brace
        if ($tokenType & self::T_OPEN_PARENTHESIS) {
            $tokenSyntax[] = '(';
        }
        if ($tokenType & self::T_CLOSE_PARENTHESIS) {
            $tokenSyntax[] = ')';
        }
        if ($tokenType & self::T_OPEN_SQUARE_BRACKET) {
            $tokenSyntax[] = '[';
        }
        if ($tokenType & self::T_NOT_OPEN_SQUARE_BRACKET) {
            $tokenSyntax[] = '![';
        }
        if ($tokenType & self::T_CLOSE_SQUARE_BRACKET) {
            $tokenSyntax[] = ']';
        }
        if ($tokenType & self::T_DOUBLE_OPEN_CURLY_BRACKET) {
            $tokenSyntax[] = '{{';
        }
        if ($tokenType & self::T_NOT_DOUBLE_OPEN_CURLY_BRACKET) {
            $tokenSyntax[] = '!{{';
        }
        if ($tokenType & self::T_DOUBLE_CLOSE_CURLY_BRACKET) {
            $tokenSyntax[] = '}}';
        }

        return $tokenSyntax;
    }
711835
protected function getTypeForString($type)
    {
        switch ($type) {
            case 'string':
                return DataTypes::STRING_TYPE;
            case 'number':
                return DataTypes::NUMBER_TYPE;
            case 'date':
            case 'datetime':
                return DataTypes::DATETIME_TYPE;
            case 'boolean':
                return DataTypes::BOOLEAN_TYPE;
            case 'tags':
                return DataTypes::TAGS_TYPE;
            case 'auto-complete':
                return DataTypes::AUTO_COMPLETE_TYPE;
            default:
                return DataTypes::UNDEFINED_TYPE;
        }
    }
1297727
private function lookupEntityName($type)
    {
        $module = $this->moduleManager->getModule($type);

        if (!$module instanceof NodeModuleInterface) {
            throw new \Exception(sprintf('Type "%s" is not a NodeModule.', $type));
        }

        return $module->getEntityName();
    }
849386
public function getAsString(string $type): ?string
    {
        $ret = $this->entry[$type];
        if (is_array($ret)) {
            $ret = implode('', $ret);
        }
        return $ret;
    }
1116790
static public function getReadableType( $type )
    {
        switch ( $type )
        {
            case self::TYPE_GOOGLE:     return 'google';
            case self::TYPE_FACEBOOK:   return 'facebook';
            case self::TYPE_YAHOO:      return 'yahoo';
            case self::TYPE_TWITTER:    return 'twitter';
        }
    }
456293
public function getToken( $type = 'csrf' ) {
		// If we don't already have the token that we want
		if ( !array_key_exists( $type, $this->tokens ) ) {
			$this->logger->log( LogLevel::DEBUG, 'Getting fresh token', [ 'type' => $type ] );

			// If we know that we don't have the new module mw<1.25
			if ( $this->usePre125TokensModule ) {
				return $this->reallyGetPre125Token( $type );
			} else {
				return $this->reallyGetToken( $type );
			}

		}

		return $this->tokens[$type];
	}
1148398
private function getFormat(Type $type): string
    {
        return $type->hasParam(0) ? $type->getParam(0) : $this->defaultFormat;
    }
201255
public function getTokenName($token)
    {
        return (isset($this->names[$token])
                ? $this->names[$token]
                : $token);
    }
1006173
public function getToken($type, $allowCache=true) {
        $tokenName = $type . 'token';
        if (!empty($this->tokencache[$tokenName]) && $allowCache) {
            return $this->tokencache[$tokenName];
        }
        $tokens = $this->getTokens(array($type));
        return $tokens[$tokenName];
    }
293768
protected function getDoctrineColumnType($type)
	{
		$type = strtolower($type);

		switch ($type) {
			case 'biginteger':
				$type = 'bigint';
				break;
			case 'smallinteger':
				$type = 'smallint';
				break;
			case 'mediumtext':
			case 'longtext':
				$type = 'text';
				break;
		}

		return Type::getType($type);
	}
1318802
private function getTypeXml($type)
    {
        if (!isset($this->styles[$type])) {
            return "<{$type}/>";
        }

        return sprintf(StyleXml::BORDER_TYPE_XML,
            $type, $this->styles[$type], $this->colors[$type], $type);
    }
304783
public function tokenIs($type)
    {
        if (is_string($this->token)) {
            return ($this->token == $type);
        }

        return ($this->token[0] == $type);
    }