0 follower

Interface Yiisoft\Yii\RateLimiter\CounterInterface

Implemented byYiisoft\Yii\RateLimiter\Counter

CounterInterface implementations describe the limiting algorithm. On each {@see CounterInterface::hit()} call it determines when the next hit won't be limited.

Public Methods

Hide inherited 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

Hide inherited methods

hit() public abstract method

Determines when the next hit won't be limited. Should be called on each request.

public abstract Yiisoft\Yii\RateLimiter\CounterState hit ( string $id )
$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;