@param string|array $type

@return string
335538
public function display($type = null) : string
    {
        if (is_null($type)) {
            $type = self::DISPLAY_SHORT;
        }

        if ($type == self::DISPLAY_DURATION) {
            $format = [];

            if ($this->hour) {
                $format[] = Unit::format($this->hour, 'duration/hour');
            }

            if ($this->minute) {
                $format[] = Unit::format($this->minute, 'duration/minute');
            }

            if ($this->second) {
                $format[] = Unit::format($this->second, 'duration/second');
            }

            return Misc::joinUnits($format, 'narrow');
        }

        return Calendar::formatTime($this->toMutable(), $type);
    }
1225150
protected function typeToString($type)
    {

        if (is_object($type)) {
            return sprintf('Object::%s', get_class($type));
        }

        if (is_array($type)) {
            $types = [];

            /** @noinspection ForeachSourceInspection */
            foreach ($type as $key => $item) {
                $types[] = sprintf('%s => %s', $key, $this->typeToString($item));
            }

            return 'Array(' . implode(', ', $types) . ')';
        }

        if (is_bool($type)) {
            return sprintf('Boolean::%s', $type ? 'True' : 'False');
        }

        if (is_int($type) || is_float($type)) {
            return sprintf('Integer::%s', (string) $type);
        }

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

        return "'$type'";
    }
1108560
private function getTypeTranslation($type)
    {
        if (!array_key_exists($type, $this->typeConfiguration)) {
            return ucfirst($type);
        }

        $typeTranslationKey = $this->typeConfiguration[$type]['translation_key'];

        return $this->translator->trans($typeTranslationKey, [], 'backend');
    }
413949
protected function getType($type)
    {
        if (isset($this->typeAlias[$type])) {
            return $this->typeAlias[$type];
        }

        return $type;
    }
43111
public static function getName($type)
    {
        if (array_key_exists($type, self::$formatName)) {
            return self::$formatName[$type];
        } else {
            return Pel::fmt('Unknown format: 0x%X', $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);
    }
22078
public static function format($type)
    {
        switch ($type) {
            case self::TYPE_CREATED:
                return 'Created';

            case self::TYPE_STARTING:
                return 'Starting';

            case self::TYPE_RUNNING:
                return 'Running';

            case self::TYPE_ENDING:
                return 'Ending';

            case self::TYPE_FINISHED:
                return 'Finished';

            case self::TYPE_SUCCESS:
                return 'Success';

            case self::TYPE_FAILURE:
                return 'Failure';

            default:
                return 'Unknown';
        }
    }
102546
public static function getSubType($type)
    {
        if (preg_match('/^(.+)\[\]$/', $type, $matches) || preg_match('/^_(.+)$/', $type, $matches)) {
            return $matches[1];
        }

        return $type;
    }
1070472
private function getTypeFamily($type) {
		if (is_array($type)) {
			$r=[];
			foreach($type as $key=>$t) {
				$r[$key]=$this->getTypeFamily($t);
			}
		} else {
			switch (1 == 1) {
				case (strpos($this->STRARR, $type) !== false):
					$r = 1; // string
					break;
				case (strpos($this->DATARR, $type) !== false):
					$r = 2; // date
					break;
				case ($type == 'boolean'):
					$r = 3; // boolean
					break;
				case ($type == 'file'):
					$r = 4; // file
					break;
				default:
					$r = 0; // number
			}
		}
		return $r;
	}
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);
	}
1131638
public function hasType($type)
    {
        if ($type instanceof Type) {
            $type = $type->getName();
        }

        return \in_array($type, $this->_types);
    }
1308896
public function getFlashText($type)
    {
        if ($this->{$type}) {
            return $this->{$type};
        } elseif ($this->parent) {
            return $this->parent->getFlashText($type);
        }

        return $type;
    }
858711
public static function getCardType($type)
    {
        if (isset(self::$cardTypes[$type])) {
            return self::$cardTypes[$type];
        }
        return $type;
    }
956189
protected function extractGeneric($type)
    {
        if (empty($type)) {
            return null;
        }

        $generic = null;

        if (substr($type, -2) === '[]') {
            $generic = substr($type, 0, -2);
        }
        elseif (strtolower(substr($type, 0, 6)) === 'array<' && substr($type, -1) === '>') {
            $generic = substr($type, 6, -1);
        }

        return $generic;
    }
1004720
public static function getArrayType(string $type): ?string
    {
        if (substr($type, -2) !== '[]' || strlen($type) === 2) {
            return null;
        }

        return substr($type, 0, -2);
    }
831916
protected static function extractType($type)
    {
        if (substr($type, -2) === Connection::PARAM_ARRAY) {
            return substr($type, 0, strlen($type) - 2);
        }

        return false;
    }
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;
        }
    }