Interface Yiisoft\Yii\RateLimiter\CounterInterface
| Implemented by | Yiisoft\Yii\RateLimiter\Counter |
|---|
CounterInterface implementations describe the limiting algorithm. On each Yiisoft\Yii\RateLimiter\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\Yii\RateLimiter\CounterInterface |
Method Details
Determines when the next hit won't be limited. Should be called on each request.
| public abstract hit( string $id ): Yiisoft\Yii\RateLimiter\CounterState | ||
| $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\Yii\RateLimiter\CounterState |
Information about when the next hit won't be limited. |
|---|---|---|
public function hit(string $id): CounterState;
Signup or Login in order to comment.