private function getHeaderValue($response, $name)
    {
        $header = $response->getHeader($name);

        if (! $header || ! count($header)) {
            return 0;
        }

        return (int) array_shift($header);
    }