diff --git a/src/MastodonAPI.php b/src/MastodonAPI.php index fdf2287..1893f76 100755 --- a/src/MastodonAPI.php +++ b/src/MastodonAPI.php @@ -53,7 +53,7 @@ public function __construct( private function getResponse(string $endpoint, string $method, array $json, bool $authenticate = true): mixed { $uri = $this->config->getBaseUrl() . '/api/'; - $uri .= ConfigurationVO::API_VERSION . $endpoint; + $uri .= $this->config->apiVersion . $endpoint; $allowedMethods = array_column(HttpOperation::cases(), 'name'); if (!in_array($method, $allowedMethods)) { diff --git a/src/MastodonOAuth.php b/src/MastodonOAuth.php index ada7f3c..d556270 100644 --- a/src/MastodonOAuth.php +++ b/src/MastodonOAuth.php @@ -22,10 +22,12 @@ class MastodonOAuth * Creates the OAuth object from the configuration. */ public function __construct( - $client_name = ConfigurationVO::DEFAULT_NAME, - $mastodon_instance = ConfigurationVO::DEFAULT_INSTANCE + string $client_name = ConfigurationVO::DEFAULT_NAME, + string $mastodon_instance = ConfigurationVO::DEFAULT_INSTANCE, + string $redirectUris = ConfigurationVO::DEFAULT_REDIRECT_URIS, + string $api_version = ConfigurationVO::API_VERSION ) { - $this->config = new ConfigurationVO($client_name, $mastodon_instance); + $this->config = new ConfigurationVO($client_name, $mastodon_instance, $redirectUris, $api_version); $this->client = new Client(); }