| Total Complexity | 5 |
| Total Lines | 43 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | final class AuthConfig extends InjectableConfig |
||
| 16 | { |
||
| 17 | // Configuration source. |
||
| 18 | public const CONFIG = 'auth'; |
||
| 19 | |||
| 20 | protected array $config = [ |
||
| 21 | 'defaultTransport' => 'cookie', |
||
| 22 | 'defaultStorage' => 'session', |
||
| 23 | 'storages' => [], |
||
| 24 | 'transports' => [], |
||
| 25 | ]; |
||
| 26 | |||
| 27 | 266 | public function getDefaultTransport(): string |
|
| 30 | } |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @return Autowire[] |
||
| 34 | */ |
||
| 35 | 266 | public function getTransports(): array |
|
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @return TokenStorageInterface|class-string<TokenStorageInterface>|Autowire |
||
|
|
|||
| 42 | * @throws InvalidArgumentException |
||
| 43 | */ |
||
| 44 | 274 | public function getStorage(string $name): TokenStorageInterface|string|Autowire |
|
| 45 | { |
||
| 46 | 274 | if (!isset($this->config['storages'][$name])) { |
|
| 47 | 2 | throw new InvalidArgumentException( |
|
| 48 | 2 | \sprintf('Token storage `%s` is not defined.', $name) |
|
| 49 | ); |
||
| 50 | } |
||
| 51 | |||
| 52 | 272 | return $this->config['storages'][$name]; |
|
| 53 | } |
||
| 54 | |||
| 55 | 268 | public function getDefaultStorage(): string |
|
| 58 | } |
||
| 59 | } |
||
| 60 |