Raml\Validator\ResponseValidator::assertNoMissingHeaders PHP Method

assertNoMissingHeaders() private method

private assertNoMissingHeaders ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response )
$request Psr\Http\Message\RequestInterface
$response Psr\Http\Message\ResponseInterface
    private function assertNoMissingHeaders(RequestInterface $request, ResponseInterface $response)
    {
        $method = $request->getMethod();
        $path = $request->getUri()->getPath();
        $statusCode = $response->getStatusCode();
        $schemaHeaders = $this->schemaHelper->getResponseHeaders($method, $path, $statusCode, true);
        $missingHeaders = array_diff_key($schemaHeaders, $response->getHeaders());
        if (count($missingHeaders) === 0) {
            return;
        }
        throw new ValidatorResponseException(sprintf('Missing response headers required by the schema for %s %s with status code %s: %s', strtoupper($method), $path, $statusCode, $this->getNamedParametersAsString($missingHeaders)));
    }