Skip to content

Commit

Permalink
Getter for base url
Browse files Browse the repository at this point in the history
  • Loading branch information
muxx committed May 29, 2020
1 parent 6e2ce72 commit 3ef8a62
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Redmine/ApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ public function __construct(string $url, string $apiKey)
$this->client = new Client($url, ['X-Redmine-API-Key: ' . $apiKey]);
}

public function getBaseUrl(): string
{
return $this->client->getBaseUrl();
}

public function requestGet(string $path, ?array $queryParameters = []): ApiResponse
{
return $this->client->makeRequest($path . '.json', [
Expand Down
5 changes: 5 additions & 0 deletions lib/Redmine/Http/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ public function __construct(string $url, array $defaultHeaders = [])
$this->defaultHeaders = $defaultHeaders;
}

public function getBaseUrl(): string
{
return $this->url;
}

public function makeRequest(string $path, array $options = []): ApiResponse
{
$optionsResolver = new OptionsResolver();
Expand Down

0 comments on commit 3ef8a62

Please sign in to comment.