Yoast\WP\SEO\Config

OAuth_Client::__constructpublicYoast 1.0

OAuth_Client constructor.

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

Хуков нет.

Возвращает

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

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

$OAuth_Client = new OAuth_Client();
$OAuth_Client->__construct( $token_option, $provider, $options_helper );
$token_option(строка) (обязательный)
The option's name to save the token as.
$provider(Wincher_PKCE_Provider|GenericProvider) (обязательный)
The provider.
$options_helper(Options_Helper) (обязательный)
The Options_Helper instance.

Код OAuth_Client::__construct() Yoast 26.9

public function __construct(
	$token_option,
	$provider,
	Options_Helper $options_helper
) {
	$this->provider       = $provider;
	$this->token_option   = $token_option;
	$this->options_helper = $options_helper;

	$tokens = $this->options_helper->get( $this->token_option );

	if ( ! empty( $tokens ) ) {
		$this->token = new OAuth_Token(
			$tokens['access_token'],
			$tokens['refresh_token'],
			$tokens['expires'],
			$tokens['has_expired'],
			$tokens['created_at'],
			( $tokens['error_count'] ?? 0 )
		);
	}
}