| Total Complexity | 6 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class TokenStorageProvider implements TokenStorageProviderInterface |
||
| 12 | { |
||
| 13 | /** @var TokenStorageInterface[] */ |
||
| 14 | private array $storages = []; |
||
| 15 | |||
| 16 | 274 | public function __construct( |
|
| 20 | } |
||
| 21 | |||
| 22 | 274 | public function getStorage(?string $name = null): TokenStorageInterface |
|
| 23 | { |
||
| 24 | 274 | $name ??= $this->config->getDefaultStorage(); |
|
| 25 | |||
| 26 | 274 | if (isset($this->storages[$name])) { |
|
| 27 | 1 | return $this->storages[$name]; |
|
| 28 | } |
||
| 29 | |||
| 30 | 274 | return $this->storages[$name] = $this->resolve($name); |
|
| 31 | } |
||
| 32 | |||
| 33 | 274 | private function resolve(string $name): TokenStorageInterface |
|
| 46 | } |
||
| 47 | } |
||
| 48 |