| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | public function getBackendOptionsFor(string $username): array |
||
| 30 | { |
||
| 31 | /** @var array{api_endpoint?: string, api_key?: string} $result */ |
||
| 32 | $result = $this->get('backends')[$username] ?? []; // @phpstan-ignore-line |
||
| 33 | |||
| 34 | if (!isset($result['api_endpoint'], $result['api_key'])) { |
||
| 35 | throw new RuntimeException('Missing backend options for ' . $username); |
||
| 36 | } |
||
| 37 | |||
| 38 | return $result; |
||
| 39 | } |
||
| 56 |