Yoast\WP\SEO\MyYoast_Client\Domain

Token_Set::__construct │ public │ Yoast 1.0

Token_Set constructor.

Метод класса: Token_Set{}

Хуков нет.

Возвращает

null. Ничего (null).

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

$Token_Set = new Token_Set();
$Token_Set->__construct(;

Код Token_Set::__construct() Yoast 28.9

public function __construct(
	// phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPNativeAttributeFound -- No-op on PHP < 8.2; redacts parameter from stack traces on PHP 8.2+.
	#[SensitiveParameter]
	string $access_token,
	int $expires_at,
	string $token_type = Auth_Token_Type::DPOP,
	// phpcs:ignore PHPCompatibility.Attributes.NewAttributes.PHPNativeAttributeFound -- No-op on PHP < 8.2; redacts parameter from stack traces on PHP 8.2+.
	#[SensitiveParameter]
	?string $refresh_token = null,
	?string $id_token = null,
	?string $scope = null,
	int $error_count = 0,
	?Resource_Indicator $resource_indicator = null
) {
	if ( $access_token === '' ) {
		throw new InvalidArgumentException( 'Token_Set requires a non-empty access_token.' );
	}
	if ( $expires_at <= 0 ) {
		throw new InvalidArgumentException( 'Token_Set requires a positive expires_at timestamp.' );
	}
	if ( $token_type === '' ) {
		throw new InvalidArgumentException( 'Token_Set requires a non-empty token_type.' );
	}

	$this->access_token       = $access_token;
	$this->expires_at         = $expires_at;
	$this->token_type         = $token_type;
	$this->refresh_token      = $refresh_token;
	$this->id_token           = $id_token;
	$this->scope              = $scope;
	$this->error_count        = $error_count;
	$this->resource_indicator = ( $resource_indicator ?? new Resource_Indicator( null ) );
}