UsageTrackingTokenStorage
in package
implements
TokenStorageInterface, ServiceSubscriberInterface
A token storage that increments the session usage index when the token is accessed.
Tags
Interfaces, Classes, Traits and Enums
- TokenStorageInterface
- The TokenStorageInterface.
- ServiceSubscriberInterface
- A ServiceSubscriber exposes its dependencies via the static {@link getSubscribedServices} method.
Table of Contents
- $enableUsageTracking : mixed
- $sessionLocator : mixed
- $storage : mixed
- __construct() : mixed
- disableUsageTracking() : void
- enableUsageTracking() : void
- getSubscribedServices() : array<string|int, string>
- Returns an array of service types required by such instances, optionally keyed by the service names used internally.
- getToken() : TokenInterface|null
- Returns the current security token.
- setToken() : void
- Sets the authentication token.
Properties
$enableUsageTracking
private
mixed
$enableUsageTracking
= false
$sessionLocator
private
mixed
$sessionLocator
$storage
private
mixed
$storage
Methods
__construct()
public
__construct(TokenStorageInterface $storage, ContainerInterface $sessionLocator) : mixed
Parameters
- $storage : TokenStorageInterface
- $sessionLocator : ContainerInterface
Return values
mixed —disableUsageTracking()
public
disableUsageTracking() : void
Return values
void —enableUsageTracking()
public
enableUsageTracking() : void
Return values
void —getSubscribedServices()
Returns an array of service types required by such instances, optionally keyed by the service names used internally.
public
static getSubscribedServices() : array<string|int, string>
For mandatory dependencies:
- ['logger' => 'Psr\Log\LoggerInterface'] means the objects use the "logger" name internally to fetch a service which must implement Psr\Log\LoggerInterface.
- ['loggers' => 'Psr\Log\LoggerInterface[]'] means the objects use the "loggers" name internally to fetch an iterable of Psr\Log\LoggerInterface instances.
- ['Psr\Log\LoggerInterface'] is a shortcut for
- ['Psr\Log\LoggerInterface' => 'Psr\Log\LoggerInterface']
otherwise:
- ['logger' => '?Psr\Log\LoggerInterface'] denotes an optional dependency
- ['loggers' => '?Psr\Log\LoggerInterface[]'] denotes an optional iterable dependency
- ['?Psr\Log\LoggerInterface'] is a shortcut for
- ['Psr\Log\LoggerInterface' => '?Psr\Log\LoggerInterface']
Return values
array<string|int, string> —The required service types, optionally keyed by service names
getToken()
Returns the current security token.
public
getToken() : TokenInterface|null
Return values
TokenInterface|null —A TokenInterface instance or null if no authentication information is available
setToken()
Sets the authentication token.
public
setToken([TokenInterface $token = null ]) : void
Parameters
- $token : TokenInterface = null
-
A TokenInterface token, or null if no further authentication information should be stored