Graby\Extractor\HttpClient::headerOnlyType PHP Метод

headerOnlyType() приватный Метод

Since the request is now done we directly check the Content-Type header
private headerOnlyType ( string $contentType ) : boolean
$contentType string Content-Type from the request
Результат boolean
    private function headerOnlyType($contentType)
    {
        if (!preg_match('!\\s*(([-\\w]+)/([-\\w\\+]+))!im', strtolower($contentType), $match)) {
            return false;
        }
        $match[1] = strtolower(trim($match[1]));
        $match[2] = strtolower(trim($match[2]));
        foreach (array($match[1], $match[2]) as $mime) {
            if (in_array($mime, $this->config['header_only_types'])) {
                return true;
            }
        }
        return false;
    }