Skip to content

Commit 10f772a

Browse files
committed
docs: update sample code in comment
1 parent 31fb03b commit 10f772a

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

system/Throttle/Throttler.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,9 @@ public function getTokenTime(): int
7979
*
8080
* Example:
8181
*
82-
* if (! $throttler->check($request->ipAddress(), 60, MINUTE))
83-
* {
82+
* if (! $throttler->check($request->ipAddress(), 60, MINUTE)) {
8483
* die('You submitted over 60 requests within a minute.');
85-
* }
84+
* }
8685
*
8786
* @param string $key The name to use as the "bucket" name.
8887
* @param int $capacity The number of requests the "bucket" can hold

tests/system/Throttle/ThrottleTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function testTokenTimeCalculation()
5656
$throttler->setTestTime($time);
5757

5858
$capacity = 2;
59-
$seconds = 200;
59+
$seconds = 200;
6060

6161
// refresh = 200 / 2 = 100 seconds
6262
// refresh rate = 2 / 200 = 0.01 token per second

0 commit comments

Comments
 (0)