helper method used by getters to extract and format relevant name parts

@param string $type
@param bool $pure
@return string
434139
protected function export(string $type, bool $strict = false): string
    {
        $matched = [];

        foreach ($this->parts as $part) {
            if ($part instanceof AbstractPart && $this->isType($part, $type, $strict)) {
                $matched[] = $part->normalize();
            }
        }

        return implode(' ',  $matched);
    }
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;
	}
308786
public function renderType($type, $changes)
	{
		$content = '';

		if (count($changes) > 0)
		{
			$content = "### $type\n" .
				'- ' . implode("\n- ", $changes) . "\n";
		}

		return $content . "\n";
	}
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];
    }
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';
        }
    }
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;
        }
    }
528208
public function getType($type)
    {
        $aliases = array(
            'int'    => 'integer',
            'bool'   => 'boolean',
            'double' => 'float',
            'object' => '\\stdClass'
        );
        $default = array(
            'integer', 'boolean', 'float', '\\stdClass', 'callable', 'string', 'resource', 'void', 'mixed'
        );
        $typeHintEnabled = false;

        if (isset($aliases[$type])) {
            $type = $aliases[$type];
        }

        if (!in_array($type, $default)) {
            $typeHintEnabled = true;
        }

        return array(
            'name' => $type,
            'hint' => $typeHintEnabled
        );
    }
927342
public function getClassName(string $type): string
    {
        assert(isset($this->classes[$type]));
        return $this->classes[$type];
    }
1016704
public function getName($name, $field = null, $type = null)
    {
        return implode('_', array_filter(array($type, $field, $name)));
    }
622899
public function getServiceNamesByType($types, $only_active = false)
    {
        $names = [];
        $map = $this->getServiceNameTypeMap($only_active);
        if (is_string($types)) {
            $types = array_map('trim', explode(',', trim($types, ',')));
        }
        foreach ($map as $name => $type) {
            if (false !== array_search($type, $types)) {
                $names[] = $name;
            }
        }

        return $names;
    }
682601
public function resolve(string $type) : string
    {
        $pos = strpos($type, '\\');

        if ($pos === 0) {
            return substr($type, 1); // Already fully qualified.
        }

        if ($pos === false) {
            $first = $type;
            $next = '';
        } else {
            $first = substr($type, 0, $pos);
            $next = substr($type, $pos);
        }

        $first = strtolower($first);

        if (isset($this->aliases[$first])) {
            return $this->aliases[$first] . $next;
        }

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

        return false;
    }
727456
public function getContent($type = '\\')
    {
        $content = '';
        if ($this->_borderLeft) {
            $content .= $type . 'brdrl' . $this->_borderLeft->getContent();
        }
        if ($this->_borderRight) {
            $content .= $type . 'brdrr' . $this->_borderRight->getContent();
        }
        if ($this->_borderTop) {
            $content .= $type . 'brdrt' . $this->_borderTop->getContent();
        }
        if ($this->_borderBottom) {
            $content .= $type . 'brdrb' . $this->_borderBottom->getContent();
        }
        return $content;
    }
292166
public function getBaseSnippetPath($type = null)
    {
        $path = '/' . $this->getPath('base') . '/' . $this->getPath('snippet');

        if ($type) {
            $path .= '/' . $type;
        }

        return $path;
    }
245663
public function getInlineParts($type = 'text')
    {
        $inline_parts = [];
        $mime_types = [
            'text'         => 'text/plain',
            'html'         => 'text/html',
        ];

        if (!in_array($type, array_keys($mime_types))) {
            throw new Exception('Invalid type specified for getInlineParts(). "type" can either be text or html.');
        }

        foreach ($this->parts as $partId => $part) {
            if ($this->getPart('content-type', $part) == $mime_types[$type]
                && $this->getPart('content-disposition', $part) != 'attachment'
                && !$this->partIdIsChildOfAnAttachment($partId)
            ) {
                $headers = $this->getPart('headers', $part);
                $encodingType = array_key_exists('content-transfer-encoding', $headers) ?
                    $headers['content-transfer-encoding'] : '';
                $undecoded_body = $this->decodeContentTransfer($this->getPartBody($part), $encodingType);
                $inline_parts[] = $this->charset->decodeCharset($undecoded_body, $this->getPartCharset($part));
            }
        }

        return $inline_parts;
    }
136396
public static function parseName($name, $type = 0, $ucfirst = true) {
        if ($type) {
            $name = preg_replace_callback('/_([a-zA-Z])/', function ($match) {
                return strtoupper($match[1]);
            }, $name);
            return $ucfirst ? ucfirst($name) : lcfirst($name);
        }

        return strtolower(trim(preg_replace("/[A-Z]/", "_\\0", $name), "_"));
    }
380580
public static function truncateElementType(string $type): string
    {
        if (strpos($type, '<') === false) {
            return $type;
        }
        return substr($type, 0, strpos($type, '<'));
    }