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
2 changes: 1 addition & 1 deletion src/Symfony/Component/RateLimiter/Policy/SlidingWindow.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function getId(): string
*/
public function getExpirationTime(): int
{
return $this->windowEndAt + $this->intervalInSeconds - microtime(true);
return (int) ($this->windowEndAt + $this->intervalInSeconds - microtime(true));
}

public function isExpired(): bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ public function testGetExpirationTime()

$new = SlidingWindow::createFromPreviousWindow($cachedWindow, 15);
$this->assertSame(2 * 15, $new->getExpirationTime());

usleep(10.1);
$this->assertIsInt($new->getExpirationTime());
}

public function testInvalidInterval()
Expand Down