Skip to content

Commit

Permalink
fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxim Solovev committed Jun 14, 2024
1 parent 75e4849 commit 4a1280b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/ThrottlePlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

use Http\Client\Common\Plugin;
use Http\Promise\Promise;
use InvalidArgumentException;
use Psr\Http\Message\RequestInterface;
use Symfony\Component\RateLimiter\Exception\MaxWaitDurationExceededException;
use Symfony\Component\RateLimiter\Exception\ReserveNotSupportedException;
Expand All @@ -32,8 +33,8 @@ public function __construct(LimiterInterface $rateLimiter, int $tokens = 1, ?flo

/**
* @throws MaxWaitDurationExceededException if $maxTime is set and the process needs to wait longer than its value (in seconds)
* @throws ReserveNotSupportedException if this limiter implementation doesn't support reserving tokens
* @throws \InvalidArgumentException if $tokens is larger than the maximum burst size
* @throws ReserveNotSupportedException if this limiter implementation doesn't support reserving tokens
* @throws InvalidArgumentException if $tokens is larger than the maximum burst size
*/
public function handleRequest(RequestInterface $request, callable $next, callable $first): Promise
{
Expand Down
2 changes: 1 addition & 1 deletion tests/ThrottlePluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function testMaxTime(): void

$this->expectException(MaxWaitDurationExceededException::class);
$this->expectExceptionMessage('The rate limiter wait time ("3" seconds) is longer than the provided maximum time ("1" seconds).');

$time = time();
$this->client->sendRequest(new Request('GET', ''));
$this->client->sendRequest(new Request('GET', ''));
Expand Down

0 comments on commit 4a1280b

Please sign in to comment.