| Total Complexity | 7 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 8 | class SsoBackend |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var Config of the Backends files account |
||
| 12 | */ |
||
| 13 | private ?Config $backendConfig = null; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Bind an SsoBackend |
||
| 17 | * |
||
| 18 | * @param ?SsoBackend $self |
||
| 19 | * @psalm-param-out SsoBackend $self |
||
| 20 | * @return SsoBackend |
||
| 21 | */ |
||
| 22 | public static function bind(?SsoBackend &$self = null): SsoBackend |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * hook for {@see Backend::init_backend()} |
||
| 33 | * |
||
| 34 | * @param Config $config |
||
| 35 | * @return void |
||
| 36 | */ |
||
| 37 | public function initBackend(Config $config): void |
||
| 38 | { |
||
| 39 | if ($this->backendConfig instanceof Config) { |
||
| 40 | throw new \BadMethodCallException('backend is already configured'); |
||
| 41 | } |
||
| 42 | |||
| 43 | $this->backendConfig = $config; |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * hook for {@see Backend::open()} |
||
| 48 | * |
||
| 49 | * @return void |
||
| 50 | */ |
||
| 51 | public function open(): void |
||
| 62 | ]); |
||
| 63 | } |
||
| 66 |