Conditions | 3 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3 |
Changes | 2 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
15 | 90 | public function setOption(string $key, mixed $value, bool $useInternalMethods = true): static |
|
16 | { |
||
17 | 90 | $method = 'set' . ucfirst($key); |
|
18 | 90 | if ($useInternalMethods === true && method_exists($this, $method)) { |
|
19 | 1 | $this->$method($value); |
|
20 | 1 | return $this; |
|
21 | } |
||
22 | |||
23 | 90 | $this->options[$key] = $value; |
|
24 | 90 | return $this; |
|
25 | } |
||
60 |