| Conditions | 4 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 4 |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 15 | 4 | public function options() |
|
| 16 | { |
||
| 17 | 4 | $required = $this->requiredOptions(); |
|
| 18 | |||
| 19 | 4 | if ($required) { |
|
|
|
|||
| 20 | 2 | foreach ($required as $key) { |
|
| 21 | 2 | if (!isset($this->options[$key])) { |
|
| 22 | 1 | throw CommandException::missingOption($key); |
|
| 23 | } |
||
| 24 | 1 | } |
|
| 25 | 2 | } |
|
| 26 | |||
| 27 | 3 | $this->options += $this->defaultOptions(); |
|
| 28 | |||
| 29 | 3 | return $this->options; |
|
| 30 | } |
||
| 31 | |||
| 70 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)or! empty(...)instead.