class RateLimitMiddleware implements HTTPMiddleware (View source)

Methods

public
process(HTTPRequest $request, callable $delegate)

No description

protected
string
getKeyFromRequest(HTTPRequest $request)

No description

protected
getErrorHTTPResponse()

No description

protected
addHeadersToResponse(HTTPResponse $response, RateLimiter $limiter)

No description

public
$this
setExtraKey(string $key)

No description

public
string
getExtraKey()

No description

public
$this
setMaxAttempts(int $maxAttempts)

No description

public
int
getMaxAttempts()

No description

public
$this
setDecay(int $decay)

No description

public
int
getDecay()

No description

public
$this
setRateLimiter(RateLimiter $rateLimiter)

No description

public
getRateLimiter()

No description

Details

HTTPResponse process(HTTPRequest $request, callable $delegate)

No description

Parameters

HTTPRequest $request
callable $delegate

Return Value

HTTPResponse

protected string getKeyFromRequest(HTTPRequest $request)

No description

Parameters

HTTPRequest $request

Return Value

string

protected HTTPResponse getErrorHTTPResponse()

No description

Return Value

HTTPResponse

protected addHeadersToResponse(HTTPResponse $response, RateLimiter $limiter)

No description

Parameters

HTTPResponse $response
RateLimiter $limiter

$this setExtraKey(string $key)

No description

Parameters

string $key

Return Value

$this

string getExtraKey()

No description

Return Value

string

$this setMaxAttempts(int $maxAttempts)

No description

Parameters

int $maxAttempts

Return Value

$this

int getMaxAttempts()

No description

Return Value

int

$this setDecay(int $decay)

No description

Parameters

int $decay

Time in minutes

Return Value

$this

int getDecay()

No description

Return Value

int

$this setRateLimiter(RateLimiter $rateLimiter)

No description

Parameters

RateLimiter $rateLimiter

Return Value

$this

RateLimiter|null getRateLimiter()

No description

Return Value

RateLimiter|null