private function getDataFromResponse(ResponseInterface $response) { $contents = $response->getBody()->getContents(); return $contents ? json_decode($contents) : null; }