public static function responseToJson(ResponseInterface $response)
    {
        $contents = $response->getBody()->getContents();
        if (empty($contents)) {
            return [];
        }

        return \GuzzleHttp\json_decode($contents, true);
    }