Get content type from request

@param bool $short
@return null|string
341634
public function getContentType($short = true)
    {
        if (isset($_SERVER['CONTENT_TYPE'])) {
            $content_type = $_SERVER['CONTENT_TYPE'];
            if ($short) {
                return Utils::substrToString($content_type,';');
            }
            return $content_type;
        }
        return null;
    }
134006
public function getContentType()
    {
        $contentType = null;
        $_contentType = $this->getHeader('Content-Type');
        if (!empty($_contentType)) {
            $_contentType = explode(';', $_contentType[0]);
            $contentType = $_contentType[0];
        }

        return $contentType;
    }
114590
public function decode($short)
    {
        $ids = $this->hashids->decode($short);

        if (empty($ids)) {
            throw new \InvalidArgumentException;
        }

        return Shortener::findOrFail(reset($ids))->getAttribute('url');
    }
1310796
public function getSynopsis($short = false)
    {
        $key = $short ? 'short' : 'long';

        if (!isset($this->synopsis[$key])) {
            $this->synopsis[$key] = trim(sprintf('%s %s', $this->name, $this->definition->getSynopsis($short)));
        }

        return $this->synopsis[$key];
    }
723387
public function getContentType()
    {
        $contentType = $this->headers->first('Content-Type');
        if (($pos = strpos($contentType, ';')) !== false) {
            $contentType = substr($contentType, 0, $pos);
        }

        return $contentType;
    }
407621
public function getMimeType(): ?string
	{
		$info = finfo_open(FILEINFO_MIME_TYPE);

		$mime = finfo_file($info, $this->getPathname());

		finfo_close($info);

		return $mime ?: null;
	}
1303759
public function Short()
    {
        if (!$this->value) {
            return null;
        }
        $formatter = $this->getFormatter(IntlDateFormatter::SHORT);
        return $formatter->format($this->getTimestamp());
    }
717811
public function getSynopsis($short = false)
    {
        $key = $short ? 'short' : 'long';

        if (!isset($this->synopsis[$key])) {
            $this->synopsis[$key] = trim(sprintf(
                '%s %s',
                $_SERVER['PHP_SELF'],
                $this->getDefinition()->getSynopsis($short)
            ));
        }

        return $this->synopsis[$key];
    }
722608
public function contentType($index = false)
    {
        if ($index === false) {
            return $this->upload['type'];
        }
        return $this->upload['type'][$index];
    }
158831
public function getText($brief = false)
    {
        if ($this->components == 0) {
            return '';
        }

        $str = $this->formatNumber($this->value[0]);
        for ($i = 1; $i < $this->components; $i ++) {
            $str .= ($brief ? ' ' : ', ');
            $str .= $this->formatNumber($this->value[$i]);
        }

        return $str;
    }
161685
private function determineContentType(Request $request)
    {
        $acceptHeader = $request->getHeaderLine('Accept');
        $selectedContentTypes = array_intersect(explode(',', $acceptHeader), $this->knownContentTypes);

        if (count($selectedContentTypes)) {
            return $selectedContentTypes[0];
        }

        return $this->defaultContentType;
    }
505071
public function short(): string
    {
        if ($this->isPrimitive()) {
            return (string) $this->phpType;
        }

        return (string) $this->className->short();
    }
464384
public function get_details($short = '') {
        global $DB, $OUTPUT;
        $output = array();
        foreach ($this->params as $p) {
            $cohortname = $DB->get_field('cohort', 'name', array('id' => $p['cohort']));
            if (!$cohortname) {
                $str = $OUTPUT->error_text(get_string('error:nosuchcohort', 'badges'));
            } else {
                $str = html_writer::tag('b', '"' . format_string($cohortname, true) . '"');
            }
            $output[] = $str;
        }

        if ($short) {
            return implode(', ', $output);
        } else {
            return html_writer::alist($output, array(), 'ul');
        }
    }
428511
public function loadContentTypeByIdentifier(Request $request)
    {
        return $this->contentTypeService->loadContentTypeByIdentifier(
            $request->query->get('identifier'),
            Language::ALL
        );
    }
1270572
function getContentType()
    {
        $formatExtension = $this->getFormatExtension();

        return isset($this->environment->contentTypes[$formatExtension])
            ? $this->environment->contentTypes[$formatExtension]
            : false;
    }
147338
public function getFullCountryName($shortTag)
    {
        $countries = $this->getCountries();
        if (\array_key_exists($shortTag, $countries)) {
            return $countries[$shortTag];
        }

        return null;
    }
400970
protected function getShortcodeData()
    {
        if($this->shortcodedata){
            return $this->shortcodedata;
        }
        $data = false;
        if($shortcode = $this->request->requestVar('Shortcode')){
            //remove BOM inside string on cursor position...
            $shortcode = str_replace("\xEF\xBB\xBF", '', $shortcode);
            $data = singleton('\Silverstripe\Shortcodable\ShortcodableParser')->the_shortcodes(array(), $shortcode);
            if(isset($data[0])){
                $this->shortcodedata = $data[0];
                return $this->shortcodedata;
            }
        }
    }