LimitResult
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.
at line 46
bool
allowed()
Determine if the operation was allowed.
at line 54
bool
denied()
Determine if the operation was denied.
at line 62
int
limit()
Get the configured capacity.
at line 70
int
remaining()
Get the immediately available capacity.
at line 78
LimitResult
withRemaining(int $remaining)
Return a copy with the given remaining capacity.
at line 92
int
retryAfter()
Get the number of seconds until the operation may be retried.
at line 100
int
resetAfter()
Get the number of seconds until the limiter is fully reset.