Yoast\WP\SEO\AI_Authorization\Domain

Token{}Yoast 1.0

Class Token Represents a token used for authentication with the AI Generator API.

Хуков нет.

Использование

$Token = new Token();
// use class methods

Методы

  1. public __construct( string $value, int $expiration )
  2. public get_value()
  3. public is_expired()
  4. ERROR: no method name found on line `$this->expiration = $expiration;`
  5. ERROR: no method name found on line `}`
  6. ERROR: no method name found on line `}`

Код 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();
	}
}