Skip to content

Commit

Permalink
Merge pull request #3 from denisyukphp/5.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
denisyukphp authored Nov 19, 2024
2 parents ad139b5 + ba64def commit 20d7d96
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
/psalm-baseline.xml export-ignore
/psalm.xml export-ignore
/tests/ export-ignore
/.Dockerfile export-ignore
/.Makefile export-ignore
/Dockerfile export-ignore
/Makefile export-ignore
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ for ($i = 1; $i <= 10; $i++) {
}
```

Below you can see the time intervals in microseconds for exponential back-off with a multiplier of `2.0` and equal jitter, where the base time is `1_000` μs and the cap time is `512_000` μs:
Below you can see the time intervals in microseconds for exponential back-off with a factor of `2.0` and equal jitter, where the base time is `1_000` μs and the cap time is `512_000` μs:

```text
+---------+---------------------------+--------------------+
Expand Down
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"friendsofphp/php-cs-fixer": "^3.10",
"php-parallel-lint/php-console-highlighter": "^1.0",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpbench/phpbench": "^1.2",
"phpunit/phpunit": "^9.5",
"psalm/plugin-phpunit": "^0.17.0",
"vimeo/psalm": "^4.26"
Expand Down
2 changes: 1 addition & 1 deletion src/LinearBackOff.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function __construct(
Duration $baseTime,
Duration $capTime,
?JitterInterface $jitter = null,
?SleeperInterface $sleeper = null
?SleeperInterface $sleeper = null,
) {
$strategy = new LinearStrategy();
$jitter ??= new NullJitter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function classify(\Throwable $throwable): bool
$result = ($this->callback)($throwable);

if (!\is_bool($result)) {
throw new \RuntimeException(sprintf('Callback must return bool, %s given.', get_debug_type($result)));
throw new \RuntimeException(\sprintf('Callback must return bool, %s given.', get_debug_type($result)));
}

return $result;
Expand Down
2 changes: 1 addition & 1 deletion src/Retry/ExceptionClassifier/ExceptionClassifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct(array $classNames = [])
private function add(string $className): void
{
if (!class_exists($className) || !is_a($className, \Throwable::class, true)) {
throw new \InvalidArgumentException(sprintf('Exception class must be a class that exists and can be thrown, "%s" given.', get_debug_type($className))); // @codeCoverageIgnore
throw new \InvalidArgumentException(\sprintf('Exception class must be a class that exists and can be thrown, "%s" given.', get_debug_type($className))); // @codeCoverageIgnore
}

$this->classNames[] = $className;
Expand Down
2 changes: 1 addition & 1 deletion tests/Retry/RetryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ classNames: [

try {
$retry->call(new CallbackSpy(static function (int $counter): never {
throw new \RuntimeException(sprintf('Exception thrown %d times.', $counter));
throw new \RuntimeException(\sprintf('Exception thrown %d times.', $counter));
}));
} catch (\RuntimeException $e) {
$this->assertSame('Exception thrown 2 times.', $e->getMessage());
Expand Down

0 comments on commit 20d7d96

Please sign in to comment.