From: Vincent Vanwaelscappel Date: Tue, 22 Aug 2023 07:26:40 +0000 (+0200) Subject: try #6202 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=7ef9c93b0436eec6f71b257cb55df6b710a3b1e5;p=cubist_util.git try #6202 --- diff --git a/src/PHP.php b/src/PHP.php index 73d6509..b6e51c6 100644 --- a/src/PHP.php +++ b/src/PHP.php @@ -81,17 +81,17 @@ class PHP /** * @param callable $callback * @param int $attempts - * @param float $pauseBetweenAttemps in seconds + * @param float $pauseBetweenAttempts in seconds * @return mixed */ - public static function retryOnError(callable $callback, $attempts = 3, $pauseBetweenAttemps = 0) + public static function retryOnError(callable $callback, $attempts = 3, $pauseBetweenAttempts = 0) { try { return call_user_func($callback); } catch (\Exception $e) { - if ($attemps > 0) { + if ($attempts > 0) { if ($pauseBetweenAttemps > 0) { - usleep($pauseBetweenAttemps / 1000000); + usleep($pauseBetweenAttempts / 1000000); } return self::retryOnError($callback, $attempts - 1); }