Skip to content

Add missing types to RateLimiter #55445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 18, 2025
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
8 changes: 4 additions & 4 deletions src/Illuminate/Cache/RateLimiter.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function limiter($name)
* @param string $key
* @param int $maxAttempts
* @param \Closure $callback
* @param int $decaySeconds
* @param \DateTimeInterface|\DateInterval|int $decaySeconds
* @return mixed
*/
public function attempt($key, $maxAttempts, Closure $callback, $decaySeconds = 60)
Expand Down Expand Up @@ -141,7 +141,7 @@ public function tooManyAttempts($key, $maxAttempts)
* Increment (by 1) the counter for a given key for a given decay time.
*
* @param string $key
* @param int $decaySeconds
* @param \DateTimeInterface|\DateInterval|int $decaySeconds
* @return int
*/
public function hit($key, $decaySeconds = 60)
Expand All @@ -153,7 +153,7 @@ public function hit($key, $decaySeconds = 60)
* Increment the counter for a given key for a given decay time by a given amount.
*
* @param string $key
* @param int $decaySeconds
* @param \DateTimeInterface|\DateInterval|int $decaySeconds
* @param int $amount
* @return int
*/
Expand Down Expand Up @@ -184,7 +184,7 @@ public function increment($key, $decaySeconds = 60, $amount = 1)
* Decrement the counter for a given key for a given decay time by a given amount.
*
* @param string $key
* @param int $decaySeconds
* @param \DateTimeInterface|\DateInterval|int $decaySeconds
* @param int $amount
* @return int
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Illuminate/Support/Facades/RateLimiter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
/**
* @method static \Illuminate\Cache\RateLimiter for(\BackedEnum|\UnitEnum|string $name, \Closure $callback)
* @method static \Closure|null limiter(\BackedEnum|\UnitEnum|string $name)
* @method static mixed attempt(string $key, int $maxAttempts, \Closure $callback, int $decaySeconds = 60)
* @method static mixed attempt(string $key, int $maxAttempts, \Closure $callback, \DateTimeInterface|\DateInterval|int $decaySeconds = 60)
* @method static bool tooManyAttempts(string $key, int $maxAttempts)
* @method static int hit(string $key, int $decaySeconds = 60)
* @method static int increment(string $key, int $decaySeconds = 60, int $amount = 1)
* @method static int decrement(string $key, int $decaySeconds = 60, int $amount = 1)
* @method static int hit(string $key, \DateTimeInterface|\DateInterval|int $decaySeconds = 60)
* @method static int increment(string $key, \DateTimeInterface|\DateInterval|int $decaySeconds = 60, int $amount = 1)
* @method static int decrement(string $key, \DateTimeInterface|\DateInterval|int $decaySeconds = 60, int $amount = 1)
* @method static mixed attempts(string $key)
* @method static mixed resetAttempts(string $key)
* @method static int remaining(string $key, int $maxAttempts)
Expand Down