@param string $type

@return string
559756
public static function format($type)
    {
        switch ($type) {
            case self::TYPE_INTERNAL:
                return 'Internal';

            case self::TYPE_LDAP:
                return 'LDAP';

            case self::TYPE_GITHUB:
                return 'GitHub.com';

            case self::TYPE_GITHUB_ENTERPRISE:
                return 'GitHub Ent.';

            default:
                return 'Unknown';
        }
    }
1177067
protected function getInheritanceTypeString($type)
    {
        if ( ! isset(static::$inheritanceTypeMap[$type])) {
            throw new \InvalidArgumentException(sprintf('Invalid provided InheritanceType: %s', $type));
        }

        return static::$inheritanceTypeMap[$type];
    }
742221
public function getTypeName($type = null)
	{
		$group = $this->getGroup();
		$type  = $type === null ? $this->getType() : $type;

		return $GLOBALS['BOOTSTRAP']['wrappers'][$group][$type]['name'];
	}
1080224
protected static function cleanType($type)
    {
        $type = str_replace([
            "\r",
            "\n",
            "\t",
            '{',
            '}',
            '[',
            ']',
            ';',
        ], '', $type);
        $type = preg_replace('/[\s]+/', ' ', $type);
        return trim($type);
    }
1138349
public function getFieldFor($type)
    {
        if (!isset($this->typemap[$type])) {
            return false;
        }
        $class = $this->typemap[$type];

        return $this->get($class, ['type' => $type]);
    }
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);
	}
1107611
public static function getValue(string $type): string
    {
        switch ($type) {
            case '3':
                /* I18N: Quality of source information - GEDCOM tag “QUAY 3” */
                return I18N::translate('primary evidence');
            case '2':
                /* I18N: Quality of source information - GEDCOM tag “QUAY 2” */
                return I18N::translate('secondary evidence');
            case '1':
                /* I18N: Quality of source information - GEDCOM tag “QUAY 1” */
                return I18N::translate('questionable evidence');
            case '0':
                /* I18N: Quality of source information - GEDCOM tag “QUAY 0” */
                return I18N::translate('unreliable evidence');
            default:
                return $type;
        }
    }
1206461
protected function getCharacter($type)
    {
        $character = $this->charSet[$type][rand(0, strlen($this->charSet[$type]) - 1)];

        if ($this->unique) {
            $this->removeFromArray($character);
        }

        return $character;
    }
371092
public static function normalizeType(string $type): string
    {
        switch ($type) {
            case self::DATA_TYPE_INT:
            case self::DATA_TYPE_BIGINT:
            case self::DATA_TYPE_TINYINT:
            case self::DATA_TYPE_SMALLINT:
            case self::DATA_TYPE_MEDIUMINT:
            case self::DATA_TYPE_INTEGER:
            case self::DATA_TYPE_SERIAL:
            case self::DATA_TYPE_BIGSERIAL:
                return 'int';
            case self::DATA_TYPE_FLOAT:
            case self::DATA_TYPE_DECIMAL:
            case self::DATA_TYPE_DOUBLE:
            case self::DATA_TYPE_DOUBLEP:
            case self::DATA_TYPE_REAL:
            case self::DATA_TYPE_NUMERIC:
                return 'float';
            case self::DATA_TYPE_BOOLEAN:
                return 'bool';
            case self::DATA_TYPE_BIT:
                return 'bit';
        }

        // all others
        return 'string';
    }
250460
private function getTypeSuffix($type)
    {
        self::$TYP_MAPPING = array_merge(self::$TYP_COMPLEX_MAPPING, self::$TYP_SIMPLE_MAPPING);

        if ($type == '') {
            return '';
        }

        if (!isset(self::$TYP_MAPPING[$this->type])) {
            return '';
        }

        return self::$TYP_MAPPING[$this->type];
    }
684783
public static function getName(int $type) : string
    {
        $names = [self::UNKNOWN => 'unknown', self::STANDARD => 'standard', self::FULL => 'full', self::LITE => 'lite'];
        return $names[$type] ?? 'invalid';
    }
527793
protected function _getIdGeneratorTypeString($type)
    {
        switch ($type) {
            case ClassMetadataInfo::GENERATOR_TYPE_AUTO:
                return 'AUTO';

            case ClassMetadataInfo::GENERATOR_TYPE_SEQUENCE:
                return 'SEQUENCE';

            case ClassMetadataInfo::GENERATOR_TYPE_TABLE:
                return 'TABLE';

            case ClassMetadataInfo::GENERATOR_TYPE_IDENTITY:
                return 'IDENTITY';

            case ClassMetadataInfo::GENERATOR_TYPE_UUID:
                return 'UUID';

            case ClassMetadataInfo::GENERATOR_TYPE_CUSTOM:
                return 'CUSTOM';
        }
    }
556051
public function toPhpSupportedScalar(string $type): string
    {
        if ($this->isPhpScalarType($type)) {
            return $type;
        }

        if ($type === 'short') {
            return 'float';
        }
        if ($type === 'double') {
            return 'float';
        }
        if ($type === 'boolean') {
            return 'bool';
        }

        return $type;
    }
6533
public static function typeToString($type)
    {
        switch ($type) {
            case self::EOF_TYPE:
                return 'EOF';
            case self::BANG_TYPE:
                return '!';
            case self::DOLLAR_TYPE:
                return '$';
            case self::PAREN_L_TYPE:
                return '(';
            case self::PAREN_R_TYPE:
                return ')';
            case self::SPREAD_TYPE:
                return '...';
            case self::COLON_TYPE:
                return ':';
            case self::EQUALS_TYPE:
                return '=';
            case self::AT_TYPE:
                return '@';
            case self::BRACKET_L_TYPE:
                return '[';
            case self::BRACKET_R_TYPE:
                return ']';
            case self::BRACE_L_TYPE:
                return '{';
            case self::PIPE_TYPE:
                return '|';
            case self::BRACE_R_TYPE:
                return '}';
            case self::NAME_TYPE:
                return 'Name';
            case self::VARIABLE_TYPE:
                return 'Variable';
            case self::INT_TYPE:
                return 'Int';
            case self::FLOAT_TYPE:
                return 'Float';
            case self::STRING_TYPE:
                return 'String';
            default:
                throw new \LogicException(sprintf('Token of type "%s" does not exist.', $type));
        }
    }
1257531
private static function getTyped($type)
    {
        if (!isset(static::$types[$type])) {
            static::$types[$type] = new self($type);
        }

        return static::$types[$type];
    }
132690
public static function getType($type)
    {
        if (!isset(self::$typesMap[$type])) {
            throw new \InvalidArgumentException(sprintf('Invalid type specified "%s".', $type));
        }
        if (!isset(self::$typeObjects[$type])) {
            $className                = self::$typesMap[$type];
            self::$typeObjects[$type] = new $className;
        }

        return self::$typeObjects[$type];
    }
390571
protected function type($type)
    {
        $type = strtolower($type);
        switch ($type) {
                case 'success':
                    $type = 'success';
                    break;
                case 'error':
                    $type = 'danger';
                    break;
                case 'information':
                    $type = 'info';
                    break;
                case 'warning':
                    $type = 'warning';
                    break;
                case 'primary':
                    $type = 'primary';
                    break;
                case 'secondary':
                    $type = 'secondary';
                    break;
                case 'dark':
                    $type = 'Dark';
                    break;
                default:
                    $type = 'light';
                    break;
            }
        $this->type = $type;
    }