src/Retriever.php
private function getModelClassNameFromContentTypeWithContentTypeVerification(
        RequestInterface $request,
        ResponseInterface $response
    ): string {
        $contentType = $this->getContentTypeFromResponse($response);
        $modelClassName = $this->getModelClassNameForContentType($contentType);

        $isAllowedContentType = in_array($contentType->getTypeSubtypeString(), $this->allowedContentTypes);

        if (!$isAllowedContentType && !$this->allowUnknownResourceTypes) {
            throw new InvalidResponseContentTypeException($contentType, $request, $response);
        }

        return $modelClassName;
    }
private function getModelClassNameFromContentTypeWithContentTypeVerification(
        RequestInterface $request,
        ResponseInterface $response
    ): string {
        $contentType = $this->getContentTypeFromResponse($response);
        $modelClassName = $this->getModelClassNameForContentType($contentType);

        $isAllowedContentType = in_array($contentType->getTypeSubtypeString(), $this->allowedContentTypes);

        if (!$isAllowedContentType && !$this->allowUnknownResourceTypes) {
            throw new InvalidResponseContentTypeException($contentType, $request, $response);
        }

        return $modelClassName;
    }
@param RequestInterface $request
@param ResponseInterface $response

@return string

@throws InternetMediaTypeParseException
@throws InvalidResponseContentTypeException