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 |
||
28 | public function getBackendOptionsFor(string $backend): array |
||
29 | { |
||
30 | /** @var array{api_endpoint?: string, api_key?: string} $result */ |
||
31 | $result = $this->get('backends')[$backend] ?? []; // @phpstan-ignore-line |
||
32 | |||
33 | if (!isset($result['api_endpoint'], $result['api_key'])) { |
||
34 | throw new RuntimeException('Missing backend options for ' . $backend); |
||
35 | } |
||
36 | |||
37 | return $result; |
||
38 | } |
||
50 |