Final Class Yiisoft\Csrf\StubCsrfToken
| Inheritance | Yiisoft\Csrf\StubCsrfToken |
|---|---|
| Implements | Yiisoft\Csrf\CsrfTokenInterface |
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\Csrf\StubCsrfToken | |
| getValue() | Yiisoft\Csrf\StubCsrfToken | |
| validate() | Yiisoft\Csrf\StubCsrfToken |
Method Details
| public __construct( string|null $token = null ): mixed | ||
| $token | string|null | |
public function __construct(?string $token = null)
{
if (null === $token) {
$token = Random::string();
}
$this->token = $token;
}
Signup or Login in order to comment.