Backend
Less than 1 minute
Backend
Abstract base class for rate limiter backends.
class Backend implements \Hazaar\Util\RateLimiter\Interface\BackendImplements: Hazaar\Util\RateLimiter\Interface\Backend
Holds the window length and the pruning of timestamps that have fallen out of it.
Properties
windowLength
The length of the rate limiting window in seconds.
protected int $windowLength = 60Type: int
Methods
setWindowLength
Sets the length of the rate limiting window.
public setWindowLength(int $windowLength): voidReturns: void
Parameters
| Parameter | Type | Description |
|---|---|---|
$windowLength | int | the window length in seconds |
prune
Drops timestamps older than the window from a stored log.
protected prune(mixed $log): arrayReturns: array
Parameters
| Parameter | Type | Description |
|---|---|---|
$log | mixed |
Generated by Hazaar API Doc Generator on Thu, 22 Oct 2026 05:05:29 +0000