ProviderLiveTestMemoryStorage
extends MemoryStorage
in package
FinalYes
Extends the standard memory storage so that it also saves tokens as JSON in the given path
Table of Contents
Properties
- $logger : LoggerInterface
- $options : OAuthOptions|SettingsContainerInterface
- $states : array<string|int, mixed>
- the CSRF state storage array
- $storagePath : string
- $tokens : array<string|int, mixed>
- the token storage array
Methods
- __construct() : mixed
- clearAccessToken() : static
- clearAllAccessTokens() : static
- clearAllCSRFStates() : static
- clearCSRFState() : static
- fromStorage() : AccessToken
- Retrieves token JOSN from the underlying storage engine and returns an AccessToken
- getAccessToken() : AccessToken
- getCSRFState() : string
- hasAccessToken() : bool
- hasCSRFState() : bool
- setLogger() : static
- Sets a logger. (LoggerAwareInterface is stupid)
- storeAccessToken() : static
- storeCSRFState() : static
- toStorage() : mixed
- Prepares an AccessToken for storage (serialize, encrypt etc.) and returns a value that is suited for the underlying storage engine
- construct() : void
- A replacement constructor that you can call in extended classes, so that you don't have to implement the monstrous original `__construct()`
- getServiceName() : string
- Gets the current service provider name
Properties
$logger
protected
LoggerInterface
$logger
= new NullLogger()
$options
protected
OAuthOptions|SettingsContainerInterface
$options
= new OAuthOptions()
$states
the CSRF state storage array
protected
array<string|int, mixed>
$states
= []
$storagePath
protected
string
$storagePath
$tokens
the token storage array
protected
array<string|int, mixed>
$tokens
= []
Methods
__construct()
public
__construct([OAuthOptions|SettingsContainerInterface $options = null ][, string $storagePath = null ]) : mixed
Parameters
- $options : OAuthOptions|SettingsContainerInterface = null
- $storagePath : string = null
clearAccessToken()
public
clearAccessToken(string $service) : static
Parameters
- $service : string
Tags
Return values
staticclearAllAccessTokens()
public
clearAllAccessTokens() : static
Tags
Return values
staticclearAllCSRFStates()
public
clearAllCSRFStates() : static
Tags
Return values
staticclearCSRFState()
public
clearCSRFState(string $service) : static
Parameters
- $service : string
Tags
Return values
staticfromStorage()
Retrieves token JOSN from the underlying storage engine and returns an AccessToken
public
fromStorage(mixed $data) : AccessToken
Parameters
- $data : mixed
Tags
Return values
AccessTokengetAccessToken()
public
getAccessToken([string $service = null ]) : AccessToken
Parameters
- $service : string = null
Tags
Return values
AccessTokengetCSRFState()
public
getCSRFState(string $service) : string
Parameters
- $service : string
Tags
Return values
stringhasAccessToken()
public
hasAccessToken(string $service) : bool
Parameters
- $service : string
Tags
Return values
boolhasCSRFState()
public
hasCSRFState(string $service) : bool
Parameters
- $service : string
Tags
Return values
boolsetLogger()
Sets a logger. (LoggerAwareInterface is stupid)
public
setLogger(LoggerInterface $logger) : static
Parameters
- $logger : LoggerInterface
Tags
Return values
staticstoreAccessToken()
public
storeAccessToken(AccessToken $token[, string $service = null ]) : static
Parameters
- $token : AccessToken
- $service : string = null
Tags
Return values
staticstoreCSRFState()
public
storeCSRFState(string $state, string $service) : static
Parameters
- $state : string
- $service : string
Tags
Return values
statictoStorage()
Prepares an AccessToken for storage (serialize, encrypt etc.) and returns a value that is suited for the underlying storage engine
public
toStorage(AccessToken $token) : mixed
Parameters
- $token : AccessToken
Tags
construct()
A replacement constructor that you can call in extended classes, so that you don't have to implement the monstrous original `__construct()`
protected
construct() : void
getServiceName()
Gets the current service provider name
protected
getServiceName(string $service) : string
Parameters
- $service : string