Return DOCTYPE tag of specified type

@param string $type Document type (html5, xhtml, 'xhtml-trans, xhtml-strict)
779043
public static function doctype($type)
    {
        $doctypes = array(
            'html5'        => '<!DOCTYPE html>',
            'xhtml'        => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
            'xhtml-trans'  => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',
            'xhtml-strict' => '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',
        );

        if ($doctypes[$type]) {
            self::$doctype = preg_replace('/-\w+$/', '', $type);
            return $doctypes[$type];
        }

        return '';
    }
533653
public function getPDOParamType($type)
	{
		switch($type)
		{
			case 'b':
				return PDO::PARAM_BOOL;
			case 'd':
				return PDO::PARAM_INT;
			case 'l':
				return PDO::PARAM_LOB;
			default:
				return PDO::PARAM_STR;
		}
	}
605209
private function getFileBackType($type)
    {
        switch ($type) {
            case Mirakl::DOCUMENT_LEGAL_IDENTITY_OF_REPRESENTATIVE:
                return Mirakl::DOCUMENT_LEGAL_IDENTITY_OF_REP_REAR;
            case Mirakl::DOCUMENT_SOLE_MAN_BUS_IDENTITY:
                return Mirakl::DOCUMENT_SOLE_MAN_BUS_IDENTITY_REAR;
            default:
                return false;
        }
    }
850729
public function getParamFormat(string $type): string
    {
        return ltrim(($this->containerPrefix.'.entity.'.$this->entityName.'.'.$type), '.');
    }
1079270
public static function getDocumentByType($documentType)
    {
        $documentType = strtoupper($documentType);
        if (isset(self::$availableDocumentList[$documentType])) {
            return self::$availableDocumentList[$documentType];
        } else {
            return false;
        }
    }
375162
public static function normalizeDataType(string $type): string
    {
        $searchType = strtolower($type);

        return array_key_exists($searchType, self::$normalizations) ? self::$normalizations[$searchType] : $type;
    }
694060
protected function _getMethodNameForType($type = null) {
		$result = '_getValueForString';
		if (empty($type)) {
			return $result;
		}

		$type = mb_strtolower($type);
		$methodName = '_getValueFor' . Inflector::camelize($type);
		if (method_exists($this, $methodName)) {
			$result = $methodName;
		}

		return $result;
	}
84421
private function getLongTypeFromType(string $type): string
    {
        $reflection = new \ReflectionObject($this);
        foreach ($reflection->getConstants() as $const => $value) {
            if (0 === strpos($const, 'TYPE_')) {
                if ($type === $value) {
                    return strtolower(substr($const, 5));
                }
            }
        }

        return 'info';
    }
1099332
public function getGeneratorMethod($type)
    {
        switch ($type) {
            case in_array($type, $this->inputGroups['hidden']):
                return 'makeHidden';

            case in_array($type, $this->inputGroups['text']):
                return 'makeText';

            case in_array($type, $this->inputGroups['select']):
                return 'makeSelected';

            case in_array($type, $this->inputGroups['checkbox']):
                return 'makeCheckbox';

            case in_array($type, $this->inputGroups['radio']):
                return 'makeRadio';

            case in_array($type, $this->inputGroups['relationship']):
                return 'makeRelationship';

            default:
                return 'makeHTMLInputString';
        }
    }
260648
public function getClassForType(string $type):?string
    {
        if (isset($this->typeMap[$type])) {
            return $this->typeMap[$type];
        }

        return null;
    }
144723
public function getDoctypeFromConfig($config)
    {
        // recommended test
        $doctype = $config->get('HTML.Doctype');
        if (!empty($doctype)) {
            return $doctype;
        }
        $doctype = $config->get('HTML.CustomDoctype');
        if (!empty($doctype)) {
            return $doctype;
        }
        // backwards-compatibility
        if ($config->get('HTML.XHTML')) {
            $doctype = 'XHTML 1.0';
        } else {
            $doctype = 'HTML 4.01';
        }
        if ($config->get('HTML.Strict')) {
            $doctype .= ' Strict';
        } else {
            $doctype .= ' Transitional';
        }
        return $doctype;
    }
1166432
public function xml($type = 'dom')
	{
		$xml = $this->content;
		$type = trim(strtolower($type));
		switch($type)
		{
			case 'dom':
				$xml = new \DOMDocument();
				$xml->loadXML($this->content);
				break;
			case 'simple':
				$xml = new \SimpleXMLElement($this->content);
				break;
		}

		return $xml;
	}
1257531
private static function getTyped($type)
    {
        if (!isset(static::$types[$type])) {
            static::$types[$type] = new self($type);
        }

        return static::$types[$type];
    }
849821
private function checkTemplate($document, $type)
    {
        $area = $this->areas->get($type);

        return $document->getStructureType() === $area['template'];
    }
858711
public static function getCardType($type)
    {
        if (isset(self::$cardTypes[$type])) {
            return self::$cardTypes[$type];
        }
        return $type;
    }
168324
private function getDomDocumentType(string $data): string
    {
        $startPos = $endPos = \stripos($data, '<!doctype');
        $braces = 0;
        do {
            $char = $data[$endPos++];
            if ('<' === $char) {
                ++$braces;
            }
            if ('>' === $char) {
                --$braces;
            }
        } while ($braces > 0);

        $internalSubset = \substr($data, $startPos, $endPos - $startPos);
        $internalSubset = \str_replace(["\n", "\r"], '', $internalSubset);
        $internalSubset = \preg_replace('/\s{2,}/', ' ', $internalSubset);
        $internalSubset = \str_replace(['[ <!', '> ]>'], ['[<!', '>]>'], $internalSubset);

        return $internalSubset;
    }
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;
        }
    }