Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/MastodonAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
8 changes: 5 additions & 3 deletions src/MastodonOAuth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down