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