Auth
in package
Table of Contents
Properties
- $access_token : string
- $expire_time : int
- $expires_in : int
- $owner_id : string
- $refresh_token : string
- $refresh_token_expire_time : int
- $refresh_token_expires_in : int
- $scope : string
- $token_type : string
Methods
- __construct() : mixed
- Auth constructor.
- accessToken() : string
- Get the access token.
- accessTokenValid() : bool
- Return whether or not the access token is valid (i.e. not expired).
- data() : array<string|int, mixed>
- Get all auth data.
- refreshToken() : string
- Get the refresh token.
- refreshTokenValid() : bool
- Return whether or not the refresh token is valid (i.e. not expired).
- reset() : $this
- Reset all auth fields.
- setData() : $this
- Set the auth data using the provided data array.
- tokenType() : string
- Get the token type.
Properties
$access_token
protected
string
$access_token
$expire_time
protected
int
$expire_time
$expires_in
protected
int
$expires_in
$owner_id
protected
string
$owner_id
$refresh_token
protected
string
$refresh_token
$refresh_token_expire_time
protected
int
$refresh_token_expire_time
$refresh_token_expires_in
protected
int
$refresh_token_expires_in
$scope
protected
string
$scope
$token_type
protected
string
$token_type
Methods
__construct()
Auth constructor.
public
__construct() : mixed
accessToken()
Get the access token.
public
accessToken() : string
Return values
stringaccessTokenValid()
Return whether or not the access token is valid (i.e. not expired).
public
accessTokenValid() : bool
Return values
bool —True if the access token is valid, otherwise false.
data()
Get all auth data.
public
data() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array containing all of the currently set auth data.
refreshToken()
Get the refresh token.
public
refreshToken() : string
Return values
stringrefreshTokenValid()
Return whether or not the refresh token is valid (i.e. not expired).
public
refreshTokenValid() : bool
Return values
bool —True if the access token is valid, otherwise false.
reset()
Reset all auth fields.
public
reset() : $this
Return values
$thissetData()
Set the auth data using the provided data array.
public
setData([array<string|int, mixed> $data = [] ]) : $this
Only updates provided fields i.e. any field not provided does NOT get reset. Does nothing if an empty array is provided. Use reset() if you with to clear existing data.
Parameters
- $data : array<string|int, mixed> = []
-
Any auth data to set.
Return values
$thistokenType()
Get the token type.
public
tokenType() : string