| Conditions | 3 |
| Paths | 4 |
| Total Lines | 13 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 3.0261 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 83 | 29 | public function addOption($option) |
|
| 84 | { |
||
| 85 | 29 | if (is_array($option)) { |
|
| 86 | 26 | $option = new Option($option); |
|
| 87 | } |
||
| 88 | |||
| 89 | 29 | if ($option instanceof Option) { |
|
| 90 | 29 | $this->options[] = $option; |
|
| 91 | |||
| 92 | 29 | return $this; |
|
| 93 | } |
||
| 94 | |||
| 95 | throw new InvalidArgumentException('The option must be an instance of ' . Option::class . ' or a keyed array'); |
||
| 96 | } |
||
| 98 |