Final Class Yiisoft\Yii\RateLimiter\Policy\LimitCallback
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| fingerprint() | Yiisoft\ |
Method Details
| public mixed __construct ( Closure $receiver ) | ||
| $receiver | Closure | |
public function __construct(private Closure $receiver) {}
| public string fingerprint ( \ | ||
| $request | \ |
|
public function fingerprint(ServerRequestInterface $request): string
{
$id = ($this->receiver)($request);
if (!is_string($id) || '' === $id) {
throw new InvalidArgumentException('The id must be a non-empty-string.');
}
return $id;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.