Documentation

MemoryStorage extends OAuthStorageAbstract
in package

Implements a memory storage adapter.

Note: the memory storage is not persistent, as tokens are only stored during script runtime.

Table of Contents

Properties

$logger  : LoggerInterface
$options  : OAuthOptions|SettingsContainerInterface
$states  : array<string|int, mixed>
the CSRF state storage array
$tokens  : array<string|int, mixed>
the token storage array

Methods

__construct()  : mixed
OAuthStorageAbstract constructor.
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

$states

the CSRF state storage array

protected array<string|int, mixed> $states = []

$tokens

the token storage array

protected array<string|int, mixed> $tokens = []

Methods

__construct()

OAuthStorageAbstract constructor.

public __construct([OAuthOptions|SettingsContainerInterface $options = new OAuthOptions() ][, LoggerInterface $logger = new NullLogger() ]) : mixed
Parameters
$options : OAuthOptions|SettingsContainerInterface = new OAuthOptions()
$logger : LoggerInterface = new NullLogger()

clearAccessToken()

public clearAccessToken(string $service) : static
Parameters
$service : string
Tags
inheritDoc
Return values
static

clearAllAccessTokens()

public clearAllAccessTokens() : static
Tags
inheritDoc
Return values
static

clearAllCSRFStates()

public clearAllCSRFStates() : static
Tags
inheritDoc
Return values
static

clearCSRFState()

public clearCSRFState(string $service) : static
Parameters
$service : string
Tags
inheritDoc
Return values
static

fromStorage()

Retrieves token JOSN from the underlying storage engine and returns an AccessToken

public fromStorage(mixed $data) : AccessToken
Parameters
$data : mixed
Tags
inheritDoc
Return values
AccessToken

getCSRFState()

public getCSRFState(string $service) : string
Parameters
$service : string
Tags
inheritDoc
Return values
string

hasAccessToken()

public hasAccessToken(string $service) : bool
Parameters
$service : string
Tags
inheritDoc
Return values
bool

hasCSRFState()

public hasCSRFState(string $service) : bool
Parameters
$service : string
Tags
inheritDoc
Return values
bool

setLogger()

Sets a logger. (LoggerAwareInterface is stupid)

public setLogger(LoggerInterface $logger) : static
Parameters
$logger : LoggerInterface
Tags
inheritDoc
codeCoverageIgnore
Return values
static

storeAccessToken()

public storeAccessToken(AccessToken $token, string $service) : static
Parameters
$token : AccessToken
$service : string
Tags
inheritDoc
Return values
static

storeCSRFState()

public storeCSRFState(string $state, string $service) : static
Parameters
$state : string
$service : string
Tags
inheritDoc
Return values
static

toStorage()

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
inheritDoc

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

        
On this page

Search results