| 1 | <?php |
||
| 5 | abstract class AbstractCommand implements CommandInterface |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * @var array |
||
| 9 | */ |
||
| 10 | private $options = []; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @inheritDoc |
||
| 14 | */ |
||
| 15 | public function options() |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @inheritDoc |
||
| 32 | */ |
||
| 33 | public function withOptions(array $options) |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @inheritDoc |
||
| 43 | */ |
||
| 44 | public function addOptions(array $options) |
||
| 51 | |||
| 52 | /** |
||
| 53 | * @inheritDoc |
||
| 54 | */ |
||
| 55 | public function hasOption($name) |
||
| 59 | } |
||
| 60 |
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.