<?php
declare(strict_types=1);
namespace GNexus\GAuth\Support;
use GNexus\GAuth\Contract\TokenStoreInterface;
use GNexus\GAuth\DTO\TokenSet;
final class InMemoryTokenStore implements TokenStoreInterface
{
/**
* @var array<string, TokenSet>
*/
private array $items = [];
public function put(string $key, TokenSet $tokenSet): void
{
$this->items[$key] = $tokenSet;
}
public function get(string $key): ?TokenSet
{
return $this->items[$key] ?? null;
}
public function forget(string $key): void
{
unset($this->items[$key]);
}
}