@@ -30,28 +30,28 @@ |
||
| 30 | 30 | |
| 31 | 31 | public static function constant(int $maxRetries = self::DEFAULT_MAX_RETRIES, int $uInterval = 1000) : self |
| 32 | 32 | { |
| 33 | - return new self(static function (int $retries) use ($maxRetries, $uInterval) { |
|
| 33 | + return new self(static function(int $retries) use ($maxRetries, $uInterval) { |
|
| 34 | 34 | return $retries > $maxRetries ? null : $uInterval; |
| 35 | 35 | }); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | public static function exponential(int $maxRetries = self::DEFAULT_MAX_RETRIES, int $uBase = 1000) : self |
| 39 | 39 | { |
| 40 | - return new self(static function (int $retries) use ($maxRetries, $uBase) { |
|
| 40 | + return new self(static function(int $retries) use ($maxRetries, $uBase) { |
|
| 41 | 41 | return $retries > $maxRetries ? null : $uBase ** $retries; |
| 42 | 42 | }); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | public static function linear(int $maxRetries = self::DEFAULT_MAX_RETRIES, int $uStep = 1000) : self |
| 46 | 46 | { |
| 47 | - return new self(static function (int $retries) use ($maxRetries, $uStep) { |
|
| 47 | + return new self(static function(int $retries) use ($maxRetries, $uStep) { |
|
| 48 | 48 | return $retries > $maxRetries ? null : $uStep * $retries; |
| 49 | 49 | }); |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | public static function custom(\Closure $getDelay) : self |
| 53 | 53 | { |
| 54 | - return new self(static function (int $retries) use ($getDelay) : ?int { |
|
| 54 | + return new self(static function(int $retries) use ($getDelay) : ?int { |
|
| 55 | 55 | return $getDelay($retries); |
| 56 | 56 | }); |
| 57 | 57 | } |