HEX
Server: Apache
System: Linux andromeda.lojoweb.com 4.18.0-372.26.1.el8_6.x86_64 #1 SMP Tue Sep 13 06:07:14 EDT 2022 x86_64
User: nakedfoamlojoweb (1056)
PHP: 8.0.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //proc/thread-self/cwd/wp-content/plugins/wordpress-seo/src/ai-authorization/domain/token.php
<?php

namespace Yoast\WP\SEO\AI_Authorization\Domain;

/**
 * Class Token
 * Represents a token used for authentication with the AI Generator API.
 */
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();
	}
}