| 1 | <?php |
||
| 5 | abstract class AbstractCommand implements CommandInterface |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var array |
||
| 9 | */ |
||
| 10 | private $options = []; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @inheritDoc |
||
| 14 | */ |
||
| 15 | 4 | public function options() |
|
| 31 | |||
| 32 | /** |
||
| 33 | * @inheritDoc |
||
| 34 | */ |
||
| 35 | 3 | public function withOptions(array $options) |
|
| 42 | |||
| 43 | /** |
||
| 44 | * @inheritDoc |
||
| 45 | */ |
||
| 46 | 1 | public function addOptions(array $options) |
|
| 53 | |||
| 54 | /** |
||
| 55 | * @inheritDoc |
||
| 56 | */ |
||
| 57 | 1 | public function hasOption($name) |
|
| 61 | |||
| 62 | /** |
||
| 63 | * @inheritDoc |
||
| 64 | */ |
||
| 65 | 3 | public function defaultOptions() |
|
| 69 | } |
||
| 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.