Skip to content

Commit

Permalink
fix: the hit method to increment by one by default
Browse files Browse the repository at this point in the history
  • Loading branch information
lajouiZakariae committed Mar 18, 2024
1 parent b44cc9f commit e52a5a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/vendor/
*.log
storage/cache
test.php
test.php
tests
2 changes: 1 addition & 1 deletion src/RateLimiter.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function limitHourly(string $key, int $perHour): void
* @return void
* @throws TooManyHitsException|InvalideRateLimiterException
*/
public function hit(string $key, int $times = 0): void
public function hit(string $key, int $times = 1): void
{
$hashedKey = md5($key);

Expand Down

0 comments on commit e52a5a8

Please sign in to comment.