diff --git a/composer.json b/composer.json index b5217ce..0abd128 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "vlucas/phpdotenv": "^5.6.1" }, "require-dev": { - "phpunit/phpunit": "^12.0.0", + "phpunit/phpunit": "^9.6.21", "squizlabs/php_codesniffer": "*" }, "autoload": { diff --git a/src/SDK/API.php b/src/SDK/API.php index 8f616b4..f1b1b94 100644 --- a/src/SDK/API.php +++ b/src/SDK/API.php @@ -15,7 +15,7 @@ class API { - private const RETRYABLE_STATUS_CODES = [503, 521, 522, 524, 530]; + private const RETRYABLE_STATUS_CODES = [503, 520, 521, 522, 524, 530]; private $httpClient; private $projectId; @@ -244,7 +244,7 @@ public function generateJwtResponse(array $responseBody, ?string $refreshToken = /** * Executes an HTTP request callable, retrying on transient status codes - * (503, 521, 522, 524, 530) with delays of 100ms, 5s, 5s. + * (503, 520, 521, 522, 524, 530) with delays of 100ms, 5s, 5s. * Non-retryable RequestExceptions are re-thrown immediately. * * @param callable $requestFn Zero-argument callable that performs the Guzzle request. diff --git a/src/tests/APIRetryTest.php b/src/tests/APIRetryTest.php index ef367e0..e370835 100644 --- a/src/tests/APIRetryTest.php +++ b/src/tests/APIRetryTest.php @@ -62,7 +62,7 @@ public function testRetriesOnRetryableStatusCodeAndSucceedsOnSecondAttempt(int $ public static function retryableStatusCodeProvider(): array { - return [[503], [521], [522], [524], [530]]; + return [[503], [520], [521], [522], [524], [530]]; } public function testRetriesUpToThreeTimesAndThrowsOnExhaustion(): void