Skip to content

Commit

Permalink
Make baseURL parameter names consistent to existing ones
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-helmich committed Sep 25, 2024
1 parent c5b6637 commit 034bcb2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/MittwaldAPIV2Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ final protected function __construct(string $baseUri, string|null $apiKey = null
* create a new API token in the mStudio UI, or via the API itself
*
* @param string $apiToken The API token
* @param string $baseURL The base URL of the API. Defaults to the production API. Note that this is only useful for testing.
* @param string $baseUri The base URL of the API. Defaults to the production API. Note that this is only useful for testing.
*/
public static function newWithToken(string $apiToken, string $baseURL = self::DEFAULT_BASE_URL): static
public static function newWithToken(string $apiToken, string $baseUri = self::DEFAULT_BASE_URL): static
{
return new static($baseURL, $apiToken);
return new static($baseUri, $apiToken);
}

/**
Expand All @@ -49,11 +49,11 @@ public static function newWithToken(string $apiToken, string $baseURL = self::DE
* This is useful for endpoints that do not require authentication, such as
* the user registration endpoint, or the authentication endpoints themselves.
*
* @param string $baseURL The base URL of the API. Defaults to the production API. Note that this is only useful for testing.
* @param string $baseUri The base URL of the API. Defaults to the production API. Note that this is only useful for testing.
*/
public static function newUnauthenticated(string $baseURL = self::DEFAULT_BASE_URL): static
public static function newUnauthenticated(string $baseUri = self::DEFAULT_BASE_URL): static
{
return new static($baseURL);
return new static($baseUri);
}

/**
Expand All @@ -65,13 +65,13 @@ public static function newUnauthenticated(string $baseURL = self::DEFAULT_BASE_U
*
* @param string $email The email address of your mStudio user.
* @param string $password The password of your mStudio user.
* @param string $baseURL The base URL of the API. Defaults to the production API. Note that this is only useful for testing.
* @param string $baseUri The base URL of the API. Defaults to the production API. Note that this is only useful for testing.
*/
public static function newWithCredentials(string $email, string $password, string $baseURL = self::DEFAULT_BASE_URL): static
public static function newWithCredentials(string $email, string $password, string $baseUri = self::DEFAULT_BASE_URL): static
{
$authenticateRequest = new AuthenticateRequest(new AuthenticateRequestBody($email, $password));
$authenticateResponse = static::newUnauthenticated($baseURL)->user()->authenticate($authenticateRequest);
$authenticateResponse = static::newUnauthenticated($baseUri)->user()->authenticate($authenticateRequest);

return static::newWithToken($authenticateResponse->getBody()->getToken(), baseURL: $baseURL);
return static::newWithToken($authenticateResponse->getBody()->getToken(), baseUri: $baseUri);
}
}

0 comments on commit 034bcb2

Please sign in to comment.