| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 15 | 4 | public function options() |
|
| 16 | { |
||
| 17 | 4 | $required = $this->requiredOptions(); |
|
| 18 | |||
| 19 | 4 | if ($required) { |
|
|
|
|||
| 20 | 2 | $missing = array_diff($required, array_keys($this->options)); |
|
| 21 | 2 | if ($missing) { |
|
| 22 | 1 | throw CommandException::missingOptions($missing); |
|
| 23 | } |
||
| 24 | 1 | } |
|
| 25 | |||
| 26 | 3 | $this->options += $this->defaultOptions(); |
|
| 27 | |||
| 28 | 3 | return $this->options; |
|
| 29 | } |
||
| 30 | |||
| 77 |
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.