@@ -42,28 +42,28 @@ |
||
| 42 | 42 | |
| 43 | 43 | public static function constant(int $maxRetries = self::DEFAULT_MAX_RETRIES, int $intervalMs = 100) : self |
| 44 | 44 | { |
| 45 | - return new self(static function (int $retries) use ($maxRetries, $intervalMs) { |
|
| 45 | + return new self(static function(int $retries) use ($maxRetries, $intervalMs) { |
|
| 46 | 46 | return $retries > $maxRetries ? null : $intervalMs; |
| 47 | 47 | }); |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | public static function exponential(int $maxRetries = self::DEFAULT_MAX_RETRIES, int $baseMs = 100) : self |
| 51 | 51 | { |
| 52 | - return new self(static function (int $retries) use ($maxRetries, $baseMs) { |
|
| 52 | + return new self(static function(int $retries) use ($maxRetries, $baseMs) { |
|
| 53 | 53 | return $retries > $maxRetries ? null : $baseMs ** $retries; |
| 54 | 54 | }); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | public static function linear(int $maxRetries = self::DEFAULT_MAX_RETRIES, int $differenceMs = 100) : self |
| 58 | 58 | { |
| 59 | - return new self(static function (int $retries) use ($maxRetries, $differenceMs) { |
|
| 59 | + return new self(static function(int $retries) use ($maxRetries, $differenceMs) { |
|
| 60 | 60 | return $retries > $maxRetries ? null : $differenceMs * $retries; |
| 61 | 61 | }); |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | public static function custom(\Closure $getDelayMs) : self |
| 65 | 65 | { |
| 66 | - return new self(static function (int $retries, \Throwable $e) use ($getDelayMs) : ?int { |
|
| 66 | + return new self(static function(int $retries, \Throwable $e) use ($getDelayMs) : ?int { |
|
| 67 | 67 | return $getDelayMs($retries, $e); |
| 68 | 68 | }); |
| 69 | 69 | } |