AbstractRequestRateLimiter
in package
implements
RequestRateLimiterInterface
An implementation of RequestRateLimiterInterface that fits most use-cases.
Tags
Interfaces, Classes and Traits
- RequestRateLimiterInterface
- A special type of limiter that deals with requests.
Table of Contents
- consume() : RateLimit
- reset() : void
- getLimiters() : array<string|int, LimiterInterface>
- getMinimalRateLimit() : RateLimit
Methods
consume()
public
consume(Request $request) : RateLimit
Parameters
- $request : Request
Return values
RateLimit —reset()
public
reset(Request $request) : void
Parameters
- $request : Request
Return values
void —getLimiters()
protected
abstract getLimiters(Request $request) : array<string|int, LimiterInterface>
Parameters
- $request : Request
Return values
array<string|int, LimiterInterface> —a set of limiters using keys extracted from the request
getMinimalRateLimit()
private
static getMinimalRateLimit(RateLimit $first, RateLimit $second) : RateLimit
Parameters
- $first : RateLimit
- $second : RateLimit