final class RateLimitPolicy (View source)

Defines a strictly positive maximum number of attempts within one fixed window.

Methods

__construct(int $attempts, int $windowSeconds)

Validates the fixed-window limits used by a limiter operation.

int

Returns the maximum number of attempts represented by this policy.

int
int

Returns the fixed window duration in seconds.

int

Details

__construct

__construct(int $attempts, int $windowSeconds)

Validates the fixed-window limits used by a limiter operation.

Parameters

int $attempts
int $windowSeconds

attempts

int attempts()

Returns the maximum number of attempts represented by this policy.

Return Value

int

windowSeconds

int windowSeconds()

Returns the fixed window duration in seconds.

Return Value

int