Skip to content

Commit

Permalink
Remove API version validation, to allow more flexibility
Browse files Browse the repository at this point in the history
  • Loading branch information
lizkenyon committed Sep 23, 2024
1 parent bb92e4a commit 05c19f5
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
21 changes: 1 addition & 20 deletions src/ApiVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,4 @@ class ApiVersion
public const JULY_2024 = "2024-07";
/** @var string */
public const LATEST = self::JULY_2024;

private static $ALL_VERSIONS = [
self::UNSTABLE,
self::APRIL_2022,
self::JULY_2022,
self::OCTOBER_2022,
self::JANUARY_2023,
self::APRIL_2023,
self::JULY_2023,
self::OCTOBER_2023,
self::JANUARY_2024,
self::APRIL_2024,
self::JULY_2024,
];

public static function isValid(string $version): bool
{
return in_array($version, self::$ALL_VERSIONS);
}
}
}
4 changes: 0 additions & 4 deletions src/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ public static function initialize(
);
}

if (!ApiVersion::isValid($apiVersion)) {
throw new InvalidArgumentException("Invalid API version: $apiVersion");
}

if (!preg_match("/http(s)?:\/\//", $hostName)) {
$hostName = "https://$hostName";
}
Expand Down

0 comments on commit 05c19f5

Please sign in to comment.