public static function getContentType(ResponseInterface $response): ?string
    {
        $contentTypes = $response->getHeader(HttpInterface::HEADER_CONTENT_TYPE);
        if (empty($contentTypes[0])) {
            return null;
        }

        if (false === strpos($contentTypes[0], ';')) {
            return $contentTypes[0];
        }

        return substr($contentTypes[0], 0, strpos($contentTypes[0], ';'));
    }
public static function getContentType(ResponseInterface $response): ?string
    {
        $contentTypes = $response->getHeader(HttpInterface::HEADER_CONTENT_TYPE);
        if (empty($contentTypes[0])) {
            return null;
        }

        if (false === strpos($contentTypes[0], ';')) {
            return $contentTypes[0];
        }

        return substr($contentTypes[0], 0, strpos($contentTypes[0], ';'));
    }
@param ResponseInterface $response

@return null|string