url = $api_url; $this->options = [ 'auth_bearer' => $token, 'headers' => [ 'accept-version' => $version, ], ]; $this->client = HttpClient::createForBaseUri( sprintf('https://%s', $api_url), $this->options ); } public function scopeFromBase(string $scope): string { return sprintf('https://%s/%s', $this->url, ltrim($scope, '/')); } public function get(string $scope): ResponseInterface { return $this->client->request('GET', $this->scopeFromBase($scope), ); } public function getClient(): HttpClientInterface { return $this->client; } } ?>