private ContainerInterface
$container;
private bool
$enableUsageTracking = false;
public function __construct(TokenStorageInterface
$storage, ContainerInterface
$container) { $this->storage =
$storage;
$this->container =
$container;
} public function getToken(): ?TokenInterface
{ if ($this->
shouldTrackUsage()) { // increments the internal session usage index
$this->
getSession()->
getMetadataBag();
} return $this->storage->
getToken();
} public function setToken(TokenInterface
$token = null
): void
{ $this->storage->
setToken($token);