RateLimitResult
final class RateLimitResult (View source)
Carries an immutable bucket decision after a status check or recorded attempt.
Methods
__construct(bool $allowed, int $remaining, int $retryAfterSeconds)
Initializes the decision returned to a limiter consumer.
allowed()
Indicates whether the bucket currently permits the protected operation.
bool
Returns the remaining attempts in the active fixed window.
int
Returns the number of seconds until a blocked bucket becomes available.
int
Details
__construct
__construct(bool $allowed, int $remaining, int $retryAfterSeconds)
Initializes the decision returned to a limiter consumer.
allowed
bool
allowed()
Indicates whether the bucket currently permits the protected operation.
remaining
int
remaining()
Returns the remaining attempts in the active fixed window.
retryAfterSeconds
int
retryAfterSeconds()
Returns the number of seconds until a blocked bucket becomes available.