Final Class Yiisoft\Csrf\StubCsrfToken
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
StubCsrfToken represents a simple implementation of CsrfTokenInterface.
This implementation simply stores and returns a token string. It does not perform any additional validation. It is primarily used for testing or as a placeholder implementation.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\ |
|
| getValue() | Yiisoft\ |
|
| validate() | Yiisoft\ |
Method Details
| public mixed __construct ( ?string $token = null ) | ||
| $token | ?string | |
public function __construct(?string $token = null)
{
$token ??= Random::string();
$this->token = $token;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.