class FileTokenRepository implements TokenRepositoryInterface (View source)

Class FileTokenRepository.

Properties

protected string $tokenFile Token file.

Methods

string
getTokenFile()

Get token file.

setTokenFile(string $tokenFile)

Set token file.

__construct(string $tokenFile = 'token.txt')

Constructor.

create(array $attributes)

Create token.

retrieve(string $access_token = null)

Retrieve token.

update(mixed $access_token, array $attributes)

Updates token.

void
delete(string $access_token)

Destroy token.

Details

string getTokenFile()

Get token file.

Return Value

string file

setTokenFile(string $tokenFile)

Set token file.

Parameters

string $tokenFile

__construct(string $tokenFile = 'token.txt')

Constructor.

Parameters

string $tokenFile

TokenInterface create(array $attributes)

Create token.

Parameters

array $attributes

Return Value

TokenInterface Token created.

TokenInterface|null retrieve(string $access_token = null)

Retrieve token.

Specified token, or any token available in storage.

Parameters

string $access_token

Return Value

TokenInterface|null Token, null if non found.

Exceptions

TokenNotFoundException

TokenInterface update(mixed $access_token, array $attributes)

Updates token.

Parameters

mixed $access_token
array $attributes

Return Value

TokenInterface Token

Exceptions

TokenNotFoundException

void delete(string $access_token)

Destroy token.

Parameters

string $access_token

Return Value

void

Exceptions

TokenNotFoundException