Conditions | 6 |
Paths | 6 |
Total Lines | 21 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 11.8436 |
Changes | 0 |
1 | <?php |
||
33 | 264 | protected function getOption(string $name, mixed $default = null): mixed |
|
34 | { |
||
35 | 264 | if (!$this->hasOption($name)) { |
|
36 | 120 | return $default; |
|
37 | } |
||
38 | |||
39 | 232 | if (array_key_exists($name, $this->options)) { |
|
40 | 232 | return $this->options[$name]; |
|
41 | } |
||
42 | |||
43 | if (!isset($this->aliases[$name])) { |
||
44 | return $default; |
||
45 | } |
||
46 | |||
47 | foreach ($this->aliases as $source => $aliases) { |
||
48 | if (in_array($name, $aliases, true)) { |
||
49 | return $this->getOption($source); |
||
50 | } |
||
51 | } |
||
52 | |||
53 | return false; |
||
54 | } |
||
56 |