class FetchAuthTokenCache implements FetchAuthTokenInterface (View source)

A class to implement caching for any object implementing FetchAuthTokenInterface

Traits

Methods

__construct(FetchAuthTokenInterface $fetcher, array $cacheConfig = null, CacheItemPoolInterface $cache)

No description

array
fetchAuthToken(callable $httpHandler = null)

Implements FetchAuthTokenInterface#fetchAuthToken.

string
getCacheKey()

No description

null|array
getLastReceivedToken()

No description

Details

__construct(FetchAuthTokenInterface $fetcher, array $cacheConfig = null, CacheItemPoolInterface $cache)

No description

Parameters

FetchAuthTokenInterface $fetcher
array $cacheConfig
CacheItemPoolInterface $cache

array fetchAuthToken(callable $httpHandler = null)

Implements FetchAuthTokenInterface#fetchAuthToken.

Checks the cache for a valid auth token and fetches the auth tokens from the supplied fetcher.

Parameters

callable $httpHandler

callback which delivers psr7 request

Return Value

array

a hash of auth tokens

Exceptions

Exception

string getCacheKey()

No description

Return Value

string

a key that may be used to cache the auth token.

null|array getLastReceivedToken()

No description

Return Value

null|array

{ The last received access token.