SdkState
in package
implements
ConfigurableContract
uses
ConfigurableMixin
Table of Contents
Interfaces
Properties
- $accessToken : string|null
- $accessTokenExpiration : int|null
- $accessTokenScope : array<string|int, mixed>|null
- $backchannel : string|null
- $idToken : string|null
- $refreshToken : string|null
- $user : array<string|int, mixed>|null
Methods
- __construct() : mixed
- SdkState Constructor.
- getAccessToken() : string|null
- getAccessTokenExpiration() : int|null
- getAccessTokenScope() : null|array<string|int, string>
- getBackchannel() : string|null
- getIdToken() : string|null
- getRefreshToken() : string|null
- getUser() : null|array<string|int, mixed>
- hasAccessToken() : bool
- hasAccessTokenExpiration() : bool
- hasAccessTokenScope() : bool
- hasBackchannel() : bool
- hasIdToken() : bool
- hasRefreshToken() : bool
- hasUser() : bool
- pushAccessTokenScope() : null|array<string|int, string>
- setAccessToken() : self
- setAccessTokenExpiration() : self
- setAccessTokenScope() : self
- setBackchannel() : self
- setIdToken() : self
- setRefreshToken() : self
- setUser() : self
- applyConfiguration() : self
- exceptionIfNull() : void
- filterArray() : null|array<string|int, string>
- filterArrayMixed() : null|array<string|int, mixed>
- filterDomain() : string|null
- filterString() : string
- getPropertyDefaults() : array{idToken: null, accessToken: null, accessTokenScope: null, refreshToken: null, user: null, accessTokenExpiration: null, backchannel: null}
- getPropertyValidators() : array<string|int, callable>
- validateProperties() : void
Properties
$accessToken
public
string|null
$accessToken
= null
$accessTokenExpiration
public
int|null
$accessTokenExpiration
= null
$accessTokenScope
public
array<string|int, mixed>|null
$accessTokenScope
= null
$backchannel
public
string|null
$backchannel
= null
$idToken
public
string|null
$idToken
= null
$refreshToken
public
string|null
$refreshToken
= null
$user
public
array<string|int, mixed>|null
$user
= null
Methods
__construct()
SdkState Constructor.
public
__construct([null|array<string|int, mixed> $configuration = null ][, null|string $idToken = null ][, null|string $accessToken = null ][, null|array<string|int, string> $accessTokenScope = null ][, null|string $refreshToken = null ][, null|array<string|int, mixed> $user = null ][, null|int $accessTokenExpiration = null ][, string|null $backchannel = null ]) : mixed
Parameters
- $configuration : null|array<string|int, mixed> = null
-
Optional. Pass an array of parameter keys and values to define the internal state of the SDK.
- $idToken : null|string = null
-
Optional. The id token currently in use for the session, if available.
- $accessToken : null|string = null
-
Optional. The access token currently in use for the session, if available.
- $accessTokenScope : null|array<string|int, string> = null
-
Optional. The scopes from the access token for the session, if available.
- $refreshToken : null|string = null
-
Optional. The refresh token currently in use for the session, if available.
- $user : null|array<string|int, mixed> = null
-
Optional. An array representing the user data, if available.
- $accessTokenExpiration : null|int = null
-
Optional. When the $accessToken is expected to expire, if available.
- $backchannel : string|null = null
-
Optional. The backchannel logout token assigned for the session, if available.
getAccessToken()
public
getAccessToken([Throwable|null $exceptionIfNull = null ]) : string|null
Parameters
- $exceptionIfNull : Throwable|null = null
Return values
string|nullgetAccessTokenExpiration()
public
getAccessTokenExpiration([Throwable|null $exceptionIfNull = null ]) : int|null
Parameters
- $exceptionIfNull : Throwable|null = null
Return values
int|nullgetAccessTokenScope()
public
getAccessTokenScope([Throwable|null $exceptionIfNull = null ]) : null|array<string|int, string>
Parameters
- $exceptionIfNull : Throwable|null = null
Return values
null|array<string|int, string>getBackchannel()
public
getBackchannel([Throwable|null $exceptionIfNull = null ]) : string|null
Parameters
- $exceptionIfNull : Throwable|null = null
Return values
string|nullgetIdToken()
public
getIdToken([Throwable|null $exceptionIfNull = null ]) : string|null
Parameters
- $exceptionIfNull : Throwable|null = null
Return values
string|nullgetRefreshToken()
public
getRefreshToken([Throwable|null $exceptionIfNull = null ]) : string|null
Parameters
- $exceptionIfNull : Throwable|null = null
Return values
string|nullgetUser()
public
getUser([Throwable|null $exceptionIfNull = null ]) : null|array<string|int, mixed>
Parameters
- $exceptionIfNull : Throwable|null = null
Return values
null|array<string|int, mixed> —$user an array representing user data
hasAccessToken()
public
hasAccessToken() : bool
Return values
boolhasAccessTokenExpiration()
public
hasAccessTokenExpiration() : bool
Return values
boolhasAccessTokenScope()
public
hasAccessTokenScope() : bool
Return values
boolhasBackchannel()
public
hasBackchannel() : bool
Return values
boolhasIdToken()
public
hasIdToken() : bool
Return values
boolhasRefreshToken()
public
hasRefreshToken() : bool
Return values
boolhasUser()
public
hasUser() : bool
Return values
boolpushAccessTokenScope()
public
pushAccessTokenScope(array<string|int, string>|string $scopes) : null|array<string|int, string>
Parameters
- $scopes : array<string|int, string>|string
-
a string (or array of strings) representing the scopes to add for the access token
Return values
null|array<string|int, string>setAccessToken()
public
setAccessToken([string|null $accessToken = null ]) : self
Parameters
- $accessToken : string|null = null
Return values
selfsetAccessTokenExpiration()
public
setAccessTokenExpiration([int|null $accessTokenExpiration = null ]) : self
Parameters
- $accessTokenExpiration : int|null = null
Return values
selfsetAccessTokenScope()
public
setAccessTokenScope(null|array<string|int, string> $accessTokenScope) : self
Parameters
- $accessTokenScope : null|array<string|int, string>
-
an array of strings representing the scopes for the access token
Return values
selfsetBackchannel()
public
setBackchannel([string|null $backchannel = null ]) : self
Parameters
- $backchannel : string|null = null
Return values
selfsetIdToken()
public
setIdToken([string|null $idToken = null ]) : self
Parameters
- $idToken : string|null = null
Return values
selfsetRefreshToken()
public
setRefreshToken([string|null $refreshToken = null ]) : self
Parameters
- $refreshToken : string|null = null
Return values
selfsetUser()
public
setUser(null|array<string|int, mixed> $user) : self
Parameters
- $user : null|array<string|int, mixed>
-
an array representing user data
Return values
selfapplyConfiguration()
private
applyConfiguration(null|array<string|int, mixed> $configuration) : self
Parameters
- $configuration : null|array<string|int, mixed>
Tags
Return values
selfexceptionIfNull()
private
exceptionIfNull(mixed $value[, null|Throwable $throwable = null ]) : void
Parameters
- $value : mixed
-
a value to compare against NULL
- $throwable : null|Throwable = null
-
Optional. A Throwable exception to raise if $value is NULL.
filterArray()
private
filterArray(null|array<string|int, string> $filtering[, bool $keepKeys = false ]) : null|array<string|int, string>
Parameters
- $filtering : null|array<string|int, string>
-
an array of strings to filter, or NULL
- $keepKeys : bool = false
-
Optional. Whether to keep array keys or reindex the array appropriately.
Tags
Return values
null|array<string|int, string>filterArrayMixed()
private
filterArrayMixed(null|array<string|int, mixed> $filtering[, bool $keepKeys = false ]) : null|array<string|int, mixed>
Parameters
- $filtering : null|array<string|int, mixed>
-
an array to filter, or NULL
- $keepKeys : bool = false
-
Optional. Whether to keep array keys or reindex the array appropriately.
Return values
null|array<string|int, mixed>filterDomain()
private
filterDomain(string $domain) : string|null
Parameters
- $domain : string
Return values
string|nullfilterString()
private
filterString(string $string) : string
Parameters
- $string : string
-
A string to apply sanitization filtering to.
Tags
Return values
stringgetPropertyDefaults()
private
getPropertyDefaults() : array{idToken: null, accessToken: null, accessTokenScope: null, refreshToken: null, user: null, accessTokenExpiration: null, backchannel: null}
Return values
array{idToken: null, accessToken: null, accessTokenScope: null, refreshToken: null, user: null, accessTokenExpiration: null, backchannel: null}getPropertyValidators()
private
getPropertyValidators() : array<string|int, callable>
Tags
Return values
array<string|int, callable>validateProperties()
private
validateProperties() : void