final class LimitResult implements Decision

Methods

__construct(bool $allowed, int $limit, int $remaining, int $retryAfterMicroseconds, int $resetAfterMicroseconds)

Create a new limit result.

bool
allowed()

Determine if the operation was allowed.

bool
denied()

Determine if the operation was denied.

int
limit()

Get the configured capacity.

int
remaining()

Get the immediately available capacity.

withRemaining(int $remaining)

Return a copy with the given remaining capacity.

int
retryAfter()

Get the number of seconds until the operation may be retried.

int
resetAfter()

Get the number of seconds until the limiter is fully reset.

Details

at line 15
__construct(bool $allowed, int $limit, int $remaining, int $retryAfterMicroseconds, int $resetAfterMicroseconds)

Create a new limit result.

Parameters

bool $allowed
int $limit
int $remaining
int $retryAfterMicroseconds
int $resetAfterMicroseconds

at line 46
bool allowed()

Determine if the operation was allowed.

Return Value

bool

at line 54
bool denied()

Determine if the operation was denied.

Return Value

bool

at line 62
int limit()

Get the configured capacity.

Return Value

int

at line 70
int remaining()

Get the immediately available capacity.

Return Value

int

at line 78
LimitResult withRemaining(int $remaining)

Return a copy with the given remaining capacity.

Parameters

int $remaining

Return Value

LimitResult

at line 92
int retryAfter()

Get the number of seconds until the operation may be retried.

Return Value

int

at line 100
int resetAfter()

Get the number of seconds until the limiter is fully reset.

Return Value

int