Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading