class Token implements TokenInterface (View source)

Class Token.

Properties

protected string $access_token Access token.
protected string $refresh_token Refresh token.
protected string $token_type Token type.
protected DateTime $expires_at Expires at.

Methods

__construct(string $access_token, string $refresh_token = null, string $token_type = 'Bearer', int $expires_in = null)

Constructor.

setAccessToken(string $access_token)

Set access token.

string
getAccessToken()

Get access token.

setRefreshToken(string $refresh_token)

Set refresh token.

string|null
getRefreshToken()

Get refresh token.

setTokenType(string $token_type)

Set token type.

string
getTokenType()

Get token type.

setExpiresAt(string $expires_at)

Set expires at.

getExpiresAt()

Get expires at.

bool
isExpired()

Determine if a token is expired.

Details

__construct(string $access_token, string $refresh_token = null, string $token_type = 'Bearer', int $expires_in = null)

Constructor.

Parameters

string $access_token
string $refresh_token
string $token_type
int $expires_in

setAccessToken(string $access_token)

Set access token.

Parameters

string $access_token

string getAccessToken()

Get access token.

Return Value

string

setRefreshToken(string $refresh_token)

Set refresh token.

Parameters

string $refresh_token

string|null getRefreshToken()

Get refresh token.

Return Value

string|null

setTokenType(string $token_type)

Set token type.

Parameters

string $token_type

string getTokenType()

Get token type.

Return Value

string

setExpiresAt(string $expires_at)

Set expires at.

Parameters

string $expires_at

DateTime getExpiresAt()

Get expires at.

Return Value

DateTime

bool isExpired()

Determine if a token is expired.

Return Value

bool