Conditions | 9 |
Paths | 5 |
Total Lines | 19 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 90 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
38 | public function resolveOptions(array $options): ?string |
||
39 | { |
||
40 | if (key_exists('route', $options) && $options['route']) { |
||
41 | return $options['route']; |
||
42 | } |
||
43 | |||
44 | if ((key_exists('uri', $options) && $options['uri']) || (key_exists('url', $options) && $options['url'])) { |
||
45 | return null; |
||
46 | } |
||
47 | |||
48 | if (!key_exists('admin', $options)) { |
||
49 | throw new Exception('Cannot resolve options, missing "admin" key'); |
||
50 | } |
||
51 | |||
52 | if (!key_exists('action', $options)) { |
||
53 | throw new Exception('Cannot resolve options, missing "action" key'); |
||
54 | } |
||
55 | |||
56 | return $this->resolve($options['admin'], $options['action']); |
||
57 | } |
||
59 |