| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 27 | public function options() |
||
| 28 | { |
||
| 29 | $required = $this->requiredOptions(); |
||
| 30 | |||
| 31 | if ($required) { |
||
|
|
|||
| 32 | $missing = array_diff($required, array_keys($this->options)); |
||
| 33 | if ($missing) { |
||
| 34 | throw CommandException::missingOptions($missing); |
||
| 35 | } |
||
| 36 | } |
||
| 37 | |||
| 38 | $this->options += $this->defaultOptions(); |
||
| 39 | |||
| 40 | return $this->options; |
||
| 41 | } |
||
| 42 | |||
| 81 |
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.