Interface Yiisoft\Yii\RateLimiter\CounterInterface
| Implemented by | Yiisoft\ |
|---|
CounterInterface implementations describe the limiting algorithm. On each {@see CounterInterface::hit()} call it determines when the next hit won't be limited.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| hit() | Determines when the next hit won't be limited. Should be called on each request. | Yiisoft\ |
Method Details
Determines when the next hit won't be limited. Should be called on each request.
| public abstract Yiisoft\ | ||
| $id | string |
Counter ID. Counters with distinct IDs do not affect each other. For example, using a current user ID will limit for the current user and using IP will limit by IP. |
| return | Yiisoft\ |
Information about when the next hit won't be limited. |
|---|---|---|
public function hit(string $id): CounterState;
User Contributed Notes
Leave a comment
Join the conversation to share a note.