Yoast\WP\SEO\AI_Authorization\Domain
Token{}
Class Token Represents a token used for authentication with the AI Generator API.
Хуков нет.
Использование
$Token = new Token(); // use class methods
Методы
- public __construct( string $value, int $expiration )
- public get_value()
- public is_expired()
- ERROR: no method name found on line `$this->expiration = $expiration;`
- ERROR: no method name found on line `}`
- ERROR: no method name found on line `}`
Код Token{} Token{} Yoast 27.8
class Token {
/**
* The token value.
*
* @var string
*/
private $value;
/**
* The expiration time.
*
* @var int
*/
private $expiration;
/**
* Token constructor.
*
* @param string $value The token value.
* @param int $expiration The expiration time.
*/
public function __construct( string $value, int $expiration ) {
$this->value = $value;
$this->expiration = $expiration;
}
/**
* Get the token value.
*
* @return string The token value.
*/
public function get_value(): string {
return $this->value;
}
/**
* Whether the token is expired.
*
* @return bool True if the token is expired, false otherwise.
*/
public function is_expired(): bool {
return $this->expiration < \time();
}
}