httpClient = $client; } function getClient() { return $this->httpClient; } function get(string $endpoint, array $data = []) { $stream = (string)$this->getClient()->get($endpoint, ['query' => $data])->getBody(); $body = json_decode($stream, false); return $body; } function post(string $endpoint, array $data = []) { $stream = (string)$this->getClient()->post($endpoint, ['json' => $data])->getBody(); $body = json_decode($stream, false); return $body; } }