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.

bool

Indicates whether the bucket currently permits the protected operation.

bool
int

Returns the remaining attempts in the active fixed window.

int
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.

Parameters

bool $allowed
int $remaining
int $retryAfterSeconds

allowed

bool allowed()

Indicates whether the bucket currently permits the protected operation.

Return Value

bool

remaining

int remaining()

Returns the remaining attempts in the active fixed window.

Return Value

int

retryAfterSeconds

int retryAfterSeconds()

Returns the number of seconds until a blocked bucket becomes available.

Return Value

int